Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,22 @@ jobs:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install system libraries
run: |
sudo apt-get install -y libpq-dev libxml2-dev libxslt1-dev

- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/dev_requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -56,9 +64,14 @@ jobs:
- name: Check Code Style
uses: pre-commit/action@v3.0.1

- name: Check for Django migrations
run: |
python manage.py makemigrations --dry-run --check

- name: Run migrations
run: |
python manage.py migrate

- name: Run tests
run: |
pytest -v
6 changes: 3 additions & 3 deletions .github/workflows/upload_to_dockerhub.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ jobs:
steps:
- name: Check out the repo
uses: actions/checkout@v3

- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: my-docker-hub-namespace/my-docker-hub-repository

- name: Build and push Docker image
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
Expand Down
12 changes: 12 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: check-merge-conflict
- id: debug-statements

- repo: https://github.com/pycqa/flake8
rev: 7.1.1
hooks:
Expand All @@ -13,3 +20,8 @@ repos:
- id: pyupgrade
args: [--py39-plus]

- repo: https://github.com/adamchainz/django-upgrade
rev: "1.22.2"
hooks:
- id: django-upgrade
args: [--target-version, "3.2"]
2 changes: 1 addition & 1 deletion INSTALLATION.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## Guia de instalación
## Guia de instalación

Seguí los pasos en nuestra wiki: https://github.com/PyAr/pyarweb/wiki/Instalacion-con-Docker
4 changes: 2 additions & 2 deletions community/templates/account/custom_captcha.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<div class="input-group-prepend">
<img src="{{ image }}" alt="captcha" class="captcha" />
{% if audio %}
<audio
title="{% trans "Play CAPTCHA as audio file" %}"
<audio
title="{% trans "Play CAPTCHA as audio file" %}"
src="{{ audio }}"
alt="captcha audio"
controls
Expand Down
2 changes: 1 addition & 1 deletion community/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<link rel="icon" href="{% static 'img/icons/pyar.ico' %}" type="image/ico">

{% block extra_head %}{% endblock %}

{% if GOOGLE_TRACKING_ID %}
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-169755710-1"></script>
Expand Down
2 changes: 1 addition & 1 deletion community/templates/confirm_delete.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ <h2>{% block page_title %}{% endblock %}</h2>
<form action="" method="POST">{% csrf_token %}
<p>{% blocktrans %}¿Está seguro de que desear eliminar "{{ object }}"?{% endblocktrans %}</p>
<input class="btn btn-primary" type="submit" value="{% trans 'Confirmar' %}" />
<a href="{% block return_url %}{% endblock %}" class="btn btn-default">{% trans 'Cancelar' %}</a>
<a href="{% block return_url %}{% endblock %}" class="btn btn-default">{% trans 'Cancelar' %}</a>
</form>
</div>
</main>
Expand Down
5 changes: 3 additions & 2 deletions community/urls.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from django.conf.urls import patterns, url
from django.urls import re_path
from django.conf.urls import patterns


urlpatterns = patterns(
'',
url(r'^', 'community.views.homepage', name='homepage'),
re_path(r'^', 'community.views.homepage', name='homepage'),
)
3 changes: 2 additions & 1 deletion dev_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ factory-boy==3.2.1
requests-mock==1.9.3
ipython==8.10.0
ipdb==0.13.9
flake8==4.0.1
flake8==4.0.1
pre-commit==4.0.1
18 changes: 18 additions & 0 deletions events/migrations/0007_alter_eventparticipation_seniority.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 3.2.19 on 2025-01-16 21:03

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('events', '0006_alter_event_slug'),
]

operations = [
migrations.AlterField(
model_name='eventparticipation',
name='seniority',
field=models.CharField(blank=True, choices=[('Trainee', 'Trainee'), ('Junior', 'Junior'), ('Semi Senior', 'Semi Senior'), ('Senior', 'Senior'), ('Guido', 'Soy Guido Van Rossum')], default='', max_length=100, verbose_name='experiencia'),
),
]
34 changes: 19 additions & 15 deletions events/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,27 @@
ReportEventView)

urlpatterns = [
re_path(r'^$', EventList.as_view(), name='events_list_all'),
re_path(r'^rss$', EventsFeed(), name='events_feed'),
re_path(r'^(?P<pk>\d+)/$', EventDetail.as_view(), name='detail'),
re_path(r'^add/$', EventCreate.as_view(), name='add'),
re_path(r'^(?P<pk>\d+)/editar/$', EventUpdate.as_view(), name='edit'),
re_path(r'^(?P<pk>\d+)/borrar/$', EventDelete.as_view(), name='delete'),
path('', EventList.as_view(), name='events_list_all'),
path('rss', EventsFeed(), name='events_feed'),
path('<int:pk>/', EventDetail.as_view(), name='detail'),
path('add/', EventCreate.as_view(), name='add'),
path('<int:pk>/editar/', EventUpdate.as_view(), name='edit'),
path('<int:pk>/borrar/', EventDelete.as_view(), name='delete'),
re_path(r'^(?P<slug>[\w-]+)/$', DetailView.as_view(model=Event), name='event_slug'),

# Event Registration Management
re_path(r'^(?P<pk>\d+)/inscribirse/$', EventParticipationCreate.as_view(), name='register'),
re_path(r'^(?P<pk>\d+)/inscriptos/$', EventParticipationList.as_view(), name='registered'),
re_path(r'^(?P<pk>\d+)/inscriptos/csv/$', EventParticipationDownload.as_view(),
name='registered_csv'),
re_path(r'^(?P<pk>\d+)/inscripcion/(?P<participation_pk>\d+)/$',
EventParticipationDetail.as_view(),
name='registration'),
re_path(r'^(?P<pk>\d+)/inscripcion/(?P<participation_pk>\d+)/borrar/$',
EventParticipationDelete.as_view(), name='unregister'),
path('<int:pk>/inscribirse/', EventParticipationCreate.as_view(), name='register'),
path('<int:pk>/inscriptos/', EventParticipationList.as_view(), name='registered'),
path('<int:pk>/inscriptos/csv/', EventParticipationDownload.as_view(), name='registered_csv'),
path(
'<int:pk>/inscripcion/<int:participation_pk>/',
EventParticipationDetail.as_view(),
name='registration'
),
path(
'<int:pk>/inscripcion/<int:participation_pk>/borrar/',
EventParticipationDelete.as_view(),
name='unregister'
),
path('<int:event_id>/reportar/', ReportEventView.as_view(), name='report'),
]
9 changes: 5 additions & 4 deletions joboffers/urls.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from django.urls import path
from django.urls import re_path
from .views import (
DownloadAnalyticsAsCsv, JobOfferAdminView, JobOfferAnalyticsView, JobOfferApproveView,
Expand All @@ -8,10 +9,10 @@


urlpatterns = [
re_path(r'^$', JobOfferListView.as_view(), name='list'),
re_path(r'^admin/$', JobOfferAdminView.as_view(), name='admin'),
re_path(r'^nueva/$', JobOfferCreateView.as_view(), name='add'),
re_path(r'^rss/$', JobOffersFeed(), name='feed'),
path('', JobOfferListView.as_view(), name='list'),
path('admin/', JobOfferAdminView.as_view(), name='admin'),
path('nueva/', JobOfferCreateView.as_view(), name='add'),
path('rss/', JobOffersFeed(), name='feed'),
re_path(r'^(?P<slug>[\w-]+)/rechazar/$', JobOfferRejectView.as_view(), name='reject'),
re_path(r'^(?P<slug>[\w-]+)/aceptar/$', JobOfferApproveView.as_view(), name='approve'),
re_path(
Expand Down
7 changes: 3 additions & 4 deletions news/admin.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from django import forms
from django.contrib import admin
from .models import NewsArticle
from django_summernote.widgets import SummernoteWidget

from .models import NewsArticle


class NewsAdminForm(forms.ModelForm):
class Meta:
Expand All @@ -11,8 +12,6 @@ class Meta:
widgets = {'body': SummernoteWidget()}


@admin.register(NewsArticle)
class NewsAdmin(admin.ModelAdmin):
form = NewsAdminForm


admin.site.register(NewsArticle, NewsAdmin)
24 changes: 7 additions & 17 deletions news/urls.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from django.contrib.auth.decorators import login_required
from django.views.generic.detail import DetailView
from django.urls import re_path
from django.urls import path

from .models import NewsArticle
from .views import (
Expand All @@ -12,20 +12,10 @@
)

urlpatterns = [
re_path(r'^$', NewsArticleList.as_view(),
name='news_list_all'),
re_path(r'^rss$', NewsFeed(),
name='news_feed'),
re_path(r'^add/$',
login_required(NewsArticleCreate.as_view()),
name='news_add'),
re_path(r'^(?P<pk>\d+)/$',
DetailView.as_view(model=NewsArticle),
name='news_view'),
re_path(r'^(?P<pk>\d+)/delete/$',
login_required(NewsArticleDelete.as_view()),
name='news_delete'),
re_path(r'^(?P<pk>\d+)/update/$',
login_required(NewsArticleUpdate.as_view()),
name='news_update'),
path('', NewsArticleList.as_view(), name='news_list_all'),
path('rss', NewsFeed(), name='news_feed'),
path('add/', login_required(NewsArticleCreate.as_view()), name='news_add'),
path('<int:pk>/', DetailView.as_view(model=NewsArticle), name='news_view'),
path('<int:pk>/delete/', login_required(NewsArticleDelete.as_view()), name='news_delete'),
path('<int:pk>/update/', login_required(NewsArticleUpdate.as_view()), name='news_update'),
]
8 changes: 4 additions & 4 deletions pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

## Cambios propuestos:

-
-
-
-

## Temas tratados:
<!-- Si su arreglo tiene un problema relacionado, enlácelo a continuación -->
Expand All @@ -12,8 +12,8 @@
## Pruebas realizadas:
<!-- ¿Se construye sin errores? ¿Qué has probado? ¿En qué sistema operativo lo has probado? Describe cualquier otra prueba realizada -->

-
-
-
-


## Cómo probar los cambios:
Expand Down
2 changes: 1 addition & 1 deletion pyarweb/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'ENGINE': 'django.db.backends.postgresql',
'NAME': os.environ.get('DB_NAME', os.environ.get("POSTGRES_DB", "pyarweb")),
'USER': os.environ.get('DB_USER', os.environ.get("POSTGRES_USER", "postgres")),
'PASSWORD': os.environ.get('DB_PASS', os.environ.get("POSTGRES_PASSWORD", "")),
Expand Down
24 changes: 12 additions & 12 deletions pyarweb/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import re

from django.conf import settings
from django.conf.urls import include
from django.contrib import admin
from django.urls import include, path
from django.urls import re_path
from django.views.static import serve

Expand All @@ -15,20 +15,20 @@

app_name = 'pyarweb'
urlpatterns = [
re_path(r'^irc/$', irc, name='irc'),
re_path(r'^buscador/$', buscador, name='buscador'),
path('irc/', irc, name='irc'),
path('buscador/', buscador, name='buscador'),

re_path(r'^$', homepage, name='homepage'),
path('', homepage, name='homepage'),

re_path(r'^noticias/', include('news.urls')),
re_path(r'^empresas/', include(('pycompanies.urls', 'pycompanies'), namespace='companies')),
re_path(r'^taggit_autosuggest/', include('taggit_autosuggest.urls')),
re_path(r'^summernote/', include('django_summernote.urls')),
path('noticias/', include('news.urls')),
path('empresas/', include(('pycompanies.urls', 'pycompanies'), namespace='companies')),
path('taggit_autosuggest/', include('taggit_autosuggest.urls')),
path('summernote/', include('django_summernote.urls')),
re_path(r'^admin/', admin.site.urls),
re_path(r'^accounts/', include('allauth.urls')),
re_path(r'^eventos/', include(('events.urls', 'events'), namespace='events')),
re_path(r'^captcha/', include('captcha.urls')),
re_path(r'^trabajo/', include(('joboffers.urls', 'joboffers'), namespace='joboffers')),
path('accounts/', include('allauth.urls')),
path('eventos/', include(('events.urls', 'events'), namespace='events')),
path('captcha/', include('captcha.urls')),
path('trabajo/', include(('joboffers.urls', 'joboffers'), namespace='joboffers')),

# no puedo usar el static porque no funcia en produccion y en prod django esta
# sirviendo los archivos estaticos. Esto es sacado del codigo de la funcion.
Expand Down
7 changes: 3 additions & 4 deletions pycompanies/admin.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
from django.contrib import admin

from .models import Company, UserCompanyProfile


@admin.register(UserCompanyProfile)
class UserCompanyProfileAdmin(admin.ModelAdmin):
search_fields = ('company__name', )
autocomplete_fields = ('user', 'company')


@admin.register(Company)
class CompanyAdmin(admin.ModelAdmin):
search_fields = ('name', )


admin.site.register(Company, CompanyAdmin)
admin.site.register(UserCompanyProfile, UserCompanyProfileAdmin)
22 changes: 11 additions & 11 deletions pycompanies/urls.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from django.urls import re_path
from django.urls import path

from .views import (
CompanyAdminView,
Expand All @@ -15,14 +15,14 @@

app_name = 'pycompanies'
urlpatterns = [
re_path(r'^$', CompanyListView.as_view(), name='company_list_all'),
re_path(r'^(?P<pk>\d+)/$', CompanyDetailView.as_view(), name='detail'),
re_path(r'^agregar/$', CompanyCreateView.as_view(), name='add'),
re_path(r'^(?P<pk>\d+)/editar/$', CompanyUpdateView.as_view(), name='edit'),
re_path(r'^(?P<pk>\d+)/eliminar/$', CompanyDeleteView.as_view(), name='delete'),
re_path(r'^(?P<company>\d+)/asociar/$', CompanyAssociateView.as_view(), name='associate'),
re_path(r'^asociarme/$', CompanyAssociationListView.as_view(), name='association_list'),
re_path(r'^admin/$', CompanyAdminView.as_view(), name='admin'),
re_path(r'^(?P<pk>\d+)/desasociar/$', CompanyDisassociateView.as_view(), name='disassociate'),
re_path(r'^(?P<pk>\d+)/analitica/$', CompanyAnalyticsView.as_view(), name='analytics')
path('', CompanyListView.as_view(), name='company_list_all'),
path('<int:pk>/', CompanyDetailView.as_view(), name='detail'),
path('agregar/', CompanyCreateView.as_view(), name='add'),
path('<int:pk>/editar/', CompanyUpdateView.as_view(), name='edit'),
path('<int:pk>/eliminar/', CompanyDeleteView.as_view(), name='delete'),
path('<int:company>/asociar/', CompanyAssociateView.as_view(), name='associate'),
path('asociarme/', CompanyAssociationListView.as_view(), name='association_list'),
path('admin/', CompanyAdminView.as_view(), name='admin'),
path('<int:pk>/desasociar/', CompanyDisassociateView.as_view(), name='disassociate'),
path('<int:pk>/analitica/', CompanyAnalyticsView.as_view(), name='analytics')
]
Loading
Loading