Minimal working version

* Upgrade dependencies
* Fix ugettext
* Fix bad urls
This commit is contained in:
Antoine Bartuccio 2022-08-04 00:26:43 +02:00
parent dee24fbc9c
commit 98bfc308a7
51 changed files with 1479 additions and 126 deletions

1
.gitignore vendored
View File

@ -5,7 +5,6 @@ db.sqlite3
*__pycache__* *__pycache__*
.DS_Store .DS_Store
pyrightconfig.json pyrightconfig.json
poetry.lock
dist/ dist/
.vscode/ .vscode/
env/ env/

View File

@ -27,7 +27,7 @@ from django.core.exceptions import ValidationError
from django.core import validators from django.core import validators
from django.db import models from django.db import models
from django.conf import settings from django.conf import settings
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.template import defaultfilters from django.template import defaultfilters
from phonenumber_field.modelfields import PhoneNumberField from phonenumber_field.modelfields import PhoneNumberField

View File

@ -25,7 +25,7 @@
from django.views.generic import ListView, DetailView from django.views.generic import ListView, DetailView
from django.views.generic.edit import UpdateView, CreateView, DeleteView, FormView from django.views.generic.edit import UpdateView, CreateView, DeleteView, FormView
from django.urls import reverse_lazy, reverse from django.urls import reverse_lazy, reverse
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.forms.models import modelform_factory from django.forms.models import modelform_factory
from django.core.exceptions import PermissionDenied, ValidationError from django.core.exceptions import PermissionDenied, ValidationError
from django.forms import HiddenInput from django.forms import HiddenInput

View File

@ -25,7 +25,7 @@
from django.conf import settings from django.conf import settings
from django import forms from django import forms
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from ajax_select.fields import AutoCompleteSelectField, AutoCompleteSelectMultipleField from ajax_select.fields import AutoCompleteSelectField, AutoCompleteSelectMultipleField

View File

@ -26,7 +26,7 @@
from django.db import models from django.db import models
from django.core import validators from django.core import validators
from django.conf import settings from django.conf import settings
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.core.exceptions import ValidationError, ObjectDoesNotExist from django.core.exceptions import ValidationError, ObjectDoesNotExist
from django.db import transaction from django.db import transaction
from django.urls import reverse from django.urls import reverse

View File

@ -25,7 +25,7 @@
from django.conf import settings from django.conf import settings
from django.test import TestCase from django.test import TestCase
from django.utils import timezone, html from django.utils import timezone, html
from django.utils.translation import ugettext as _ from django.utils.translation import gettext as _
from django.urls import reverse from django.urls import reverse
from django.core.management import call_command from django.core.management import call_command
from django.core.exceptions import ValidationError, NON_FIELD_ERRORS from django.core.exceptions import ValidationError, NON_FIELD_ERRORS

View File

@ -39,8 +39,8 @@ from django.http import (
) )
from django.urls import reverse, reverse_lazy from django.urls import reverse, reverse_lazy
from django.utils import timezone from django.utils import timezone
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.utils.translation import ugettext as _t from django.utils.translation import gettext as _t
from django.core.exceptions import PermissionDenied, ValidationError, NON_FIELD_ERRORS from django.core.exceptions import PermissionDenied, ValidationError, NON_FIELD_ERRORS
from django.core.paginator import Paginator, InvalidPage from django.core.paginator import Paginator, InvalidPage
from django.shortcuts import get_object_or_404, redirect from django.shortcuts import get_object_or_404, redirect

View File

@ -26,11 +26,11 @@
from django.shortcuts import render from django.shortcuts import render
from django.db import models, transaction from django.db import models, transaction
from django.db.models import Q from django.db.models import Q
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.utils import timezone from django.utils import timezone
from django.urls import reverse from django.urls import reverse
from django.conf import settings from django.conf import settings
from django.contrib.staticfiles.templatetags.staticfiles import static from django.templatetags.static import static
from django.core.mail import EmailMultiAlternatives from django.core.mail import EmailMultiAlternatives
from django.core.exceptions import ValidationError from django.core.exceptions import ValidationError

View File

@ -27,7 +27,7 @@ from django.conf import settings
from django.urls import reverse from django.urls import reverse
from django.core.management import call_command from django.core.management import call_command
from django.utils import html from django.utils import html
from django.utils.translation import ugettext as _ from django.utils.translation import gettext as _
from core.models import User, RealGroup from core.models import User, RealGroup

View File

@ -28,7 +28,7 @@ from django.http import HttpResponseRedirect
from django.views.generic import ListView, DetailView, View from django.views.generic import ListView, DetailView, View
from django.views.generic.edit import UpdateView, CreateView, DeleteView from django.views.generic.edit import UpdateView, CreateView, DeleteView
from django.views.generic.detail import SingleObjectMixin from django.views.generic.detail import SingleObjectMixin
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.urls import reverse, reverse_lazy from django.urls import reverse, reverse_lazy
from django.core.exceptions import ValidationError from django.core.exceptions import ValidationError
from django.utils import timezone from django.utils import timezone

View File

@ -21,5 +21,3 @@
# Place - Suite 330, Boston, MA 02111-1307, USA. # Place - Suite 330, Boston, MA 02111-1307, USA.
# #
# #
default_app_config = "core.apps.SithConfig"

View File

@ -34,7 +34,7 @@ from django.contrib.auth.models import (
GroupManager as AuthGroupManager, GroupManager as AuthGroupManager,
AnonymousUser as AuthAnonymousUser, AnonymousUser as AuthAnonymousUser,
) )
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.utils import timezone from django.utils import timezone
from django.core import validators from django.core import validators
from django.core.exceptions import ValidationError, PermissionDenied from django.core.exceptions import ValidationError, PermissionDenied

View File

@ -25,9 +25,9 @@
import os import os
import sass import sass
from urllib.parse import urljoin
from django.utils.encoding import force_bytes, iri_to_uri from django.utils.encoding import force_bytes, iri_to_uri
from django.core.files.base import ContentFile from django.core.files.base import ContentFile
from django.utils.six.moves.urllib.parse import urljoin
from django.templatetags.static import static from django.templatetags.static import static
from django.conf import settings from django.conf import settings
from core.scss.storage import ScssFileStorage, find_file from core.scss.storage import ScssFileStorage, find_file

View File

@ -23,7 +23,7 @@
# #
# #
from django.urls import re_path from django.urls import re_path, path
from core.views import * from core.views import *
@ -60,8 +60,8 @@ urlpatterns = [
SithPasswordResetDoneView.as_view(), SithPasswordResetDoneView.as_view(),
name="password_reset_done", name="password_reset_done",
), ),
re_path( path(
r"^reset/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$", r"reset/<str:uidb64>/<str:token>/",
SithPasswordResetConfirmView.as_view(), SithPasswordResetConfirmView.as_view(),
name="password_reset_confirm", name="password_reset_confirm",
), ),

View File

@ -29,7 +29,7 @@ from django.views.generic.edit import UpdateView, FormMixin, DeleteView
from django.views.generic.detail import SingleObjectMixin from django.views.generic.detail import SingleObjectMixin
from django.forms.models import modelform_factory from django.forms.models import modelform_factory
from django.conf import settings from django.conf import settings
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.http import HttpResponse from django.http import HttpResponse
from wsgiref.util import FileWrapper from wsgiref.util import FileWrapper
from django.urls import reverse from django.urls import reverse
@ -147,7 +147,7 @@ class FileListView(ListView):
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
kwargs = super(FileListView, self).get_context_data(**kwargs) kwargs = super(FileListView, self).get_context_data(**kwargs)
kwargs["popup"] = "" kwargs["popup"] = ""
if self.kwargs["popup"]: if self.kwargs.get("popup") is not None:
kwargs["popup"] = "popup" kwargs["popup"] = "popup"
return kwargs return kwargs
@ -165,7 +165,7 @@ class FileEditView(CanEditMixin, UpdateView):
return modelform_factory(SithFile, fields=fields) return modelform_factory(SithFile, fields=fields)
def get_success_url(self): def get_success_url(self):
if self.kwargs["popup"]: if self.kwargs.get("popup") is not None:
return reverse( return reverse(
"core:file_detail", kwargs={"file_id": self.object.id, "popup": "popup"} "core:file_detail", kwargs={"file_id": self.object.id, "popup": "popup"}
) )
@ -176,7 +176,7 @@ class FileEditView(CanEditMixin, UpdateView):
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
kwargs = super(FileEditView, self).get_context_data(**kwargs) kwargs = super(FileEditView, self).get_context_data(**kwargs)
kwargs["popup"] = "" kwargs["popup"] = ""
if self.kwargs["popup"]: if self.kwargs.get("popup") is not None:
kwargs["popup"] = "popup" kwargs["popup"] = "popup"
return kwargs return kwargs
@ -217,13 +217,13 @@ class FileEditPropView(CanEditPropMixin, UpdateView):
def get_success_url(self): def get_success_url(self):
return reverse( return reverse(
"core:file_detail", "core:file_detail",
kwargs={"file_id": self.object.id, "popup": self.kwargs["popup"] or ""}, kwargs={"file_id": self.object.id, "popup": self.kwargs.get("popup", "")},
) )
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
kwargs = super(FileEditPropView, self).get_context_data(**kwargs) kwargs = super(FileEditPropView, self).get_context_data(**kwargs)
kwargs["popup"] = "" kwargs["popup"] = ""
if self.kwargs["popup"]: if self.kwargs.get("popup") is not None:
kwargs["popup"] = "popup" kwargs["popup"] = "popup"
return kwargs return kwargs
@ -301,14 +301,14 @@ class FileView(CanViewMixin, DetailView, FormMixin):
def get_success_url(self): def get_success_url(self):
return reverse( return reverse(
"core:file_detail", "core:file_detail",
kwargs={"file_id": self.object.id, "popup": self.kwargs["popup"] or ""}, kwargs={"file_id": self.object.id, "popup": self.kwargs.get("popup", "")},
) )
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
kwargs = super(FileView, self).get_context_data(**kwargs) kwargs = super(FileView, self).get_context_data(**kwargs)
kwargs["popup"] = "" kwargs["popup"] = ""
kwargs["form"] = self.form kwargs["form"] = self.form
if self.kwargs["popup"]: if self.kwargs.get("popup") is not None:
kwargs["popup"] = "popup" kwargs["popup"] = "popup"
kwargs["clipboard"] = SithFile.objects.filter( kwargs["clipboard"] = SithFile.objects.filter(
id__in=self.request.session["clipboard"] id__in=self.request.session["clipboard"]
@ -328,20 +328,20 @@ class FileDeleteView(CanEditPropMixin, DeleteView):
return self.request.GET["next"] return self.request.GET["next"]
if self.object.parent is None: if self.object.parent is None:
return reverse( return reverse(
"core:file_list", kwargs={"popup": self.kwargs["popup"] or ""} "core:file_list", kwargs={"popup": self.kwargs.get("popup", "")}
) )
return reverse( return reverse(
"core:file_detail", "core:file_detail",
kwargs={ kwargs={
"file_id": self.object.parent.id, "file_id": self.object.parent.id,
"popup": self.kwargs["popup"] or "", "popup": self.kwargs.get("popup", ""),
}, },
) )
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
kwargs = super(FileDeleteView, self).get_context_data(**kwargs) kwargs = super(FileDeleteView, self).get_context_data(**kwargs)
kwargs["popup"] = "" kwargs["popup"] = ""
if self.kwargs["popup"]: if self.kwargs.get("popup") is not None:
kwargs["popup"] = "popup" kwargs["popup"] = "popup"
return kwargs return kwargs

View File

@ -37,8 +37,8 @@ from django.forms import (
DateTimeInput, DateTimeInput,
Textarea, Textarea,
) )
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.utils.translation import ugettext from django.utils.translation import gettext
from phonenumber_field.widgets import PhoneNumberInternationalFallbackWidget from phonenumber_field.widgets import PhoneNumberInternationalFallbackWidget
from ajax_select.fields import AutoCompleteSelectField from ajax_select.fields import AutoCompleteSelectField
from ajax_select import make_ajax_field from ajax_select import make_ajax_field
@ -118,19 +118,16 @@ class SelectFile(TextInput):
attrs["class"] = "select_file" attrs["class"] = "select_file"
else: else:
attrs = {"class": "select_file"} attrs = {"class": "select_file"}
output = ( output = '%(content)s<div name="%(name)s" class="choose_file_widget" title="%(title)s"></div>' % {
'%(content)s<div name="%(name)s" class="choose_file_widget" title="%(title)s"></div>' "content": super(SelectFile, self).render(name, value, attrs, renderer),
% { "title": _("Choose file"),
"content": super(SelectFile, self).render(name, value, attrs, renderer), "name": name,
"title": _("Choose file"), }
"name": name,
}
)
output += ( output += (
'<span name="' '<span name="'
+ name + name
+ '" class="choose_file_button">' + '" class="choose_file_button">'
+ ugettext("Choose file") + gettext("Choose file")
+ "</span>" + "</span>"
) )
return output return output
@ -142,19 +139,16 @@ class SelectUser(TextInput):
attrs["class"] = "select_user" attrs["class"] = "select_user"
else: else:
attrs = {"class": "select_user"} attrs = {"class": "select_user"}
output = ( output = '%(content)s<div name="%(name)s" class="choose_user_widget" title="%(title)s"></div>' % {
'%(content)s<div name="%(name)s" class="choose_user_widget" title="%(title)s"></div>' "content": super(SelectUser, self).render(name, value, attrs, renderer),
% { "title": _("Choose user"),
"content": super(SelectUser, self).render(name, value, attrs, renderer), "name": name,
"title": _("Choose user"), }
"name": name,
}
)
output += ( output += (
'<span name="' '<span name="'
+ name + name
+ '" class="choose_user_button">' + '" class="choose_user_button">'
+ ugettext("Choose user") + gettext("Choose user")
+ "</span>" + "</span>"
) )
return output return output

View File

@ -31,7 +31,7 @@ from django.views.generic import ListView
from django.views.generic.edit import FormView from django.views.generic.edit import FormView
from django.urls import reverse_lazy from django.urls import reverse_lazy
from django.shortcuts import get_object_or_404 from django.shortcuts import get_object_or_404
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django import forms from django import forms
from ajax_select.fields import AutoCompleteSelectMultipleField from ajax_select.fields import AutoCompleteSelectMultipleField

View File

@ -27,7 +27,7 @@
from django.shortcuts import render, redirect, get_object_or_404 from django.shortcuts import render, redirect, get_object_or_404
from django.contrib.auth import views from django.contrib.auth import views
from django.contrib.auth.forms import PasswordChangeForm from django.contrib.auth.forms import PasswordChangeForm
from django.utils.translation import ugettext as _ from django.utils.translation import gettext as _
from django.urls import reverse from django.urls import reverse
from django.core.exceptions import PermissionDenied, ValidationError from django.core.exceptions import PermissionDenied, ValidationError
from django.http import Http404, HttpResponse from django.http import Http404, HttpResponse

View File

@ -22,5 +22,3 @@
# Place - Suite 330, Boston, MA 02111-1307, USA. # Place - Suite 330, Boston, MA 02111-1307, USA.
# #
# #
default_app_config = "counter.app.CounterConfig"

View File

@ -23,7 +23,7 @@
# #
from django.apps import AppConfig from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
class CounterConfig(AppConfig): class CounterConfig(AppConfig):

View File

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from __future__ import unicode_literals from __future__ import unicode_literals
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.db import migrations, models from django.db import migrations, models
from django.conf import settings from django.conf import settings

View File

@ -24,7 +24,7 @@
from sith.settings import SITH_COUNTER_OFFICES, SITH_MAIN_CLUB from sith.settings import SITH_COUNTER_OFFICES, SITH_MAIN_CLUB
from django.db import models from django.db import models
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.utils import timezone from django.utils import timezone
from django.conf import settings from django.conf import settings
from django.urls import reverse from django.urls import reverse

View File

@ -41,7 +41,7 @@ from django.urls import reverse_lazy, reverse
from django.http import HttpResponseRedirect, HttpResponse, JsonResponse from django.http import HttpResponseRedirect, HttpResponse, JsonResponse
from django.utils import timezone from django.utils import timezone
from django import forms from django import forms
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.conf import settings from django.conf import settings
from django.db import DataError, transaction, models from django.db import DataError, transaction, models

View File

@ -12,7 +12,7 @@ Pour modifier les cotisations disponnibles, tout se gère dans la configuration
.. code-block:: python .. code-block:: python
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
SITH_SUBSCRIPTIONS = { SITH_SUBSCRIPTIONS = {
# Voici un échantillon de la véritable configuration à l'heure de l'écriture. # Voici un échantillon de la véritable configuration à l'heure de l'écriture.

View File

@ -20,7 +20,7 @@ Nous allons présenter ici les deux techniques. Dans un premier temps nous allon
from django.db import models from django.db import models
from django.conf import settings from django.conf import settings
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from core.views import * from core.views import *
from core.models import User, Group from core.models import User, Group
@ -63,7 +63,7 @@ Voici maintenant comment faire en définissant des fonctions personnalisées. Ce
.. code-block:: python .. code-block:: python
from django.db import models from django.db import models
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from core.views import * from core.views import *
from core.models import User, Group from core.models import User, Group

View File

@ -14,7 +14,7 @@ Si le mot est dans le code Python :
.. sourcecode:: python .. sourcecode:: python
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
# ... # ...

View File

@ -23,7 +23,7 @@
# #
from django.db import models, DataError from django.db import models, DataError
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.utils.functional import cached_property from django.utils.functional import cached_property
from django.conf import settings from django.conf import settings

View File

@ -33,7 +33,7 @@ from django.views.generic import TemplateView, View
from django.http import HttpResponse, HttpResponseRedirect from django.http import HttpResponse, HttpResponseRedirect
from django.core.exceptions import SuspiciousOperation from django.core.exceptions import SuspiciousOperation
from django.db import transaction, DataError from django.db import transaction, DataError
from django.utils.translation import ugettext as _ from django.utils.translation import gettext as _
from django.conf import settings from django.conf import settings
from counter.models import Customer, Counter, ProductType, Selling from counter.models import Customer, Counter, ProductType, Selling

View File

@ -1,6 +1,6 @@
from django.db import models from django.db import models
from ordered_model.models import OrderedModel from ordered_model.models import OrderedModel
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.utils import timezone from django.utils import timezone
from core.models import User, Group from core.models import User, Group

View File

@ -3,7 +3,7 @@ from django.views.generic import ListView, DetailView
from django.views.generic.edit import UpdateView, CreateView from django.views.generic.edit import UpdateView, CreateView
from django.views.generic.edit import DeleteView, FormView from django.views.generic.edit import DeleteView, FormView
from django.urls import reverse_lazy from django.urls import reverse_lazy
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.core.exceptions import PermissionDenied from django.core.exceptions import PermissionDenied
from django.db import transaction from django.db import transaction
from django.forms import CheckboxSelectMultiple from django.forms import CheckboxSelectMultiple

View File

@ -24,7 +24,7 @@
from django.db import models from django.db import models
from django.conf import settings from django.conf import settings
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.core.exceptions import ValidationError from django.core.exceptions import ValidationError
from django.urls import reverse from django.urls import reverse
from django.utils import timezone from django.utils import timezone

View File

@ -27,7 +27,7 @@ from django.shortcuts import get_object_or_404
from django.views.generic import ListView, DetailView, RedirectView from django.views.generic import ListView, DetailView, RedirectView
from django.views.generic.edit import UpdateView, CreateView, DeleteView from django.views.generic.edit import UpdateView, CreateView, DeleteView
from django.views.generic.detail import SingleObjectMixin from django.views.generic.detail import SingleObjectMixin
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.urls import reverse_lazy from django.urls import reverse_lazy
from django.utils import timezone, html from django.utils import timezone, html
from django.conf import settings from django.conf import settings

View File

@ -23,7 +23,7 @@
# #
from django.db import models, DataError from django.db import models, DataError
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.conf import settings from django.conf import settings
from django.urls import reverse from django.urls import reverse

View File

@ -28,7 +28,7 @@ import pytz
from django.views.generic import ListView, DetailView, TemplateView from django.views.generic import ListView, DetailView, TemplateView
from django.views.generic.edit import UpdateView, CreateView, DeleteView, BaseFormView from django.views.generic.edit import UpdateView, CreateView, DeleteView, BaseFormView
from django.utils.translation import ugettext as _ from django.utils.translation import gettext as _
from django.utils import dateparse, timezone from django.utils import dateparse, timezone
from django.urls import reverse_lazy from django.urls import reverse_lazy
from django.conf import settings from django.conf import settings

View File

@ -26,7 +26,7 @@ from enum import Enum
from django.views.generic import ListView, View from django.views.generic import ListView, View
from django.views.generic.edit import FormView from django.views.generic.edit import FormView
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.views.generic.detail import SingleObjectMixin from django.views.generic.detail import SingleObjectMixin
from django.http.response import HttpResponseRedirect from django.http.response import HttpResponseRedirect
from django.urls import reverse from django.urls import reverse

View File

@ -23,7 +23,7 @@
# #
from django import forms from django import forms
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.forms.widgets import Widget from django.forms.widgets import Widget
from django.templatetags.static import static from django.templatetags.static import static

View File

@ -23,7 +23,7 @@
# #
from django.db import models from django.db import models
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.utils import timezone from django.utils import timezone
from django.core import validators from django.core import validators
from django.conf import settings from django.conf import settings

View File

@ -25,7 +25,7 @@
from django.conf import settings from django.conf import settings
from django.test import TestCase from django.test import TestCase
from django.urls import reverse from django.urls import reverse
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.core.management import call_command from django.core.management import call_command
from core.models import User, Notification from core.models import User, Notification

1370
poetry.lock generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -20,29 +20,29 @@ license = "GPL-3.0-only"
[tool.poetry.dependencies] [tool.poetry.dependencies]
python = "^3.8" python = "^3.8"
Django = "^2.2" Django = "^3.2"
Pillow = "^8.3.2" Pillow = "^8.3.2"
mistune = "^0.8.4" mistune = "^0.8.4"
django-jinja = "^2.9.1" django-jinja = "^2.10"
cryptography = "36.0.2" cryptography = "36.0.2"
pyOpenSSL = "^21.0.0" pyOpenSSL = "^21.0.0"
pytz = "^2021.1" pytz = "^2021.1"
djangorestframework = "^3.12.4" djangorestframework = "^3.13"
django-phonenumber-field = "^5.2.0" django-phonenumber-field = "^5.2.0"
phonenumbers = "^8.12.33" phonenumbers = "^8.12.33"
django-ajax-selects = "^2.1.0" django-ajax-selects = "^2.1.0"
reportlab = "^3.6.1" reportlab = "^3.6.1"
django-haystack = "^3.1.1" django-haystack = "^3.2.1"
xapian-haystack = "^2.1.1" xapian-haystack = "^3.0.1"
xapian-bindings = "^0.1.0" xapian-bindings = "^0.1.0"
libsass = "^0.21.0" libsass = "^0.21.0"
django-ordered-model = "^3.4.3" django-ordered-model = "^3.4.3"
django-simple-captcha = "^0.5.14" django-simple-captcha = "^0.5.14"
python-dateutil = "^2.8.2" python-dateutil = "^2.8.2"
psycopg2-binary = "2.8.6" psycopg2-binary = "2.9.3"
sentry-sdk = "^1.4.3" sentry-sdk = "^1.4.3"
pygraphviz = "^1.9" pygraphviz = "^1.9"
Jinja2 = "<=3.0.3" Jinja2 = "^3.1"
# Extra optional dependencies # Extra optional dependencies
mysqlclient = { version = "^2.0.3", optional = true } mysqlclient = { version = "^2.0.3", optional = true }

View File

@ -23,7 +23,7 @@
# #
# #
from django.utils.translation import ugettext as _ from django.utils.translation import gettext as _
from django.views.generic.edit import FormView from django.views.generic.edit import FormView
from django.views.generic import ListView from django.views.generic import ListView
from django.urls import reverse from django.urls import reverse

View File

@ -26,7 +26,7 @@ from django.db import models
from django.urls import reverse from django.urls import reverse
from django.core.cache import cache from django.core.cache import cache
from django.conf import settings from django.conf import settings
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.utils import timezone from django.utils import timezone
from PIL import Image from PIL import Image

View File

@ -28,7 +28,7 @@ from django.urls import reverse_lazy, reverse
from core.views.forms import SelectDate from core.views.forms import SelectDate
from django.views.generic import DetailView, TemplateView from django.views.generic import DetailView, TemplateView
from django.views.generic.edit import UpdateView, FormMixin, FormView from django.views.generic.edit import UpdateView, FormMixin, FormView
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.conf import settings from django.conf import settings
from django import forms from django import forms
from django.core.exceptions import PermissionDenied from django.core.exceptions import PermissionDenied

View File

@ -41,7 +41,7 @@ import sys
import binascii import binascii
import sentry_sdk import sentry_sdk
from sentry_sdk.integrations.django import DjangoIntegration from sentry_sdk.integrations.django import DjangoIntegration
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
@ -132,9 +132,7 @@ TEMPLATES = [
"extensions": [ "extensions": [
"jinja2.ext.do", "jinja2.ext.do",
"jinja2.ext.loopcontrols", "jinja2.ext.loopcontrols",
"jinja2.ext.with_",
"jinja2.ext.i18n", "jinja2.ext.i18n",
"jinja2.ext.autoescape",
"django_jinja.builtins.extensions.CsrfExtension", "django_jinja.builtins.extensions.CsrfExtension",
"django_jinja.builtins.extensions.CacheExtension", "django_jinja.builtins.extensions.CacheExtension",
"django_jinja.builtins.extensions.TimezoneExtension", "django_jinja.builtins.extensions.TimezoneExtension",

View File

@ -37,13 +37,15 @@ Including another URLconf
1. Add an import: from blog import urls as blog_urls 1. Add an import: from blog import urls as blog_urls
2. Add a URL to urlpatterns: url(r'^blog/', include(blog_urls)) 2. Add a URL to urlpatterns: url(r'^blog/', include(blog_urls))
""" """
from django.urls import include, re_path from django.urls import include, path
from django.contrib import admin from django.contrib import admin
from django.conf import settings from django.conf import settings
from django.conf.urls.static import static from django.conf.urls.static import static
from django.views.i18n import JavaScriptCatalog from django.views.i18n import JavaScriptCatalog
from ajax_select import urls as ajax_select_urls from ajax_select import urls as ajax_select_urls
import core.urls
js_info_dict = {"packages": ("sith",)} js_info_dict = {"packages": ("sith",)}
handler403 = "core.views.forbidden" handler403 = "core.views.forbidden"
@ -51,43 +53,37 @@ handler404 = "core.views.not_found"
handler500 = "core.views.internal_servor_error" handler500 = "core.views.internal_servor_error"
urlpatterns = [ urlpatterns = [
re_path(r"^", include(("core.urls", "core"), namespace="core")), path("", include(("core.urls", "core"), namespace="core")),
re_path( path("rootplace/", include(("rootplace.urls", "rootplace"), namespace="rootplace")),
r"^rootplace/", include(("rootplace.urls", "rootplace"), namespace="rootplace") path(
), "subscription/",
re_path(
r"^subscription/",
include(("subscription.urls", "subscription"), namespace="subscription"), include(("subscription.urls", "subscription"), namespace="subscription"),
), ),
re_path(r"^com/", include(("com.urls", "com"), namespace="com")), path("com/", include(("com.urls", "com"), namespace="com")),
re_path(r"^club/", include(("club.urls", "club"), namespace="club")), path("club/", include(("club.urls", "club"), namespace="club")),
re_path(r"^counter/", include(("counter.urls", "counter"), namespace="counter")), path("counter/", include(("counter.urls", "counter"), namespace="counter")),
re_path(r"^stock/", include(("stock.urls", "stock"), namespace="stock")), path("stock/", include(("stock.urls", "stock"), namespace="stock")),
re_path( path(
r"^accounting/", "accounting/",
include(("accounting.urls", "accounting"), namespace="accounting"), include(("accounting.urls", "accounting"), namespace="accounting"),
), ),
re_path(r"^eboutic/", include(("eboutic.urls", "eboutic"), namespace="eboutic")), path("eboutic/", include(("eboutic.urls", "eboutic"), namespace="eboutic")),
re_path( path(
r"^launderette/", "launderette/",
include(("launderette.urls", "launderette"), namespace="launderette"), include(("launderette.urls", "launderette"), namespace="launderette"),
), ),
re_path(r"^sas/", include(("sas.urls", "sas"), namespace="sas")), path("sas/", include(("sas.urls", "sas"), namespace="sas")),
re_path(r"^api/v1/", include(("api.urls", "api"), namespace="api")), path("api/v1/", include(("api.urls", "api"), namespace="api")),
re_path( path("election/", include(("election.urls", "election"), namespace="election")),
r"^election/", include(("election.urls", "election"), namespace="election") path("forum/", include(("forum.urls", "forum"), namespace="forum")),
), path("trombi/", include(("trombi.urls", "trombi"), namespace="trombi")),
re_path(r"^forum/", include(("forum.urls", "forum"), namespace="forum")), path("matmatronch/", include(("matmat.urls", "matmat"), namespace="matmat")),
re_path(r"^trombi/", include(("trombi.urls", "trombi"), namespace="trombi")), path("pedagogy/", include(("pedagogy.urls", "pedagogy"), namespace="pedagogy")),
re_path(r"^matmatronch/", include(("matmat.urls", "matmat"), namespace="matmat")), path("admin/", admin.site.urls),
re_path( path("ajax_select/", include(ajax_select_urls)),
r"^pedagogy/", include(("pedagogy.urls", "pedagogy"), namespace="pedagogy") path("i18n/", include("django.conf.urls.i18n")),
), path("jsi18n/$", JavaScriptCatalog.as_view(), name="javascript-catalog"),
re_path(r"^admin/", admin.site.urls), path("captcha/", include("captcha.urls")),
re_path(r"^ajax_select/", include(ajax_select_urls)),
re_path(r"^i18n/", include("django.conf.urls.i18n")),
re_path(r"^jsi18n/$", JavaScriptCatalog.as_view(), name="javascript-catalog"),
re_path(r"^captcha/", include("captcha.urls")),
] ]
if settings.DEBUG: if settings.DEBUG:
@ -95,4 +91,4 @@ if settings.DEBUG:
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
import debug_toolbar import debug_toolbar
urlpatterns += [re_path(r"^__debug__/", include(debug_toolbar.urls))] urlpatterns += [path("__debug__/", include(debug_toolbar.urls))]

View File

@ -24,7 +24,7 @@
# #
from django.db import models from django.db import models
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.urls import reverse from django.urls import reverse
from django.conf import settings from django.conf import settings

View File

@ -37,7 +37,7 @@ from django.views.generic.edit import (
FormMixin, FormMixin,
BaseFormView, BaseFormView,
) )
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django import forms from django import forms
from django.http import HttpResponseRedirect, HttpResponse from django.http import HttpResponseRedirect, HttpResponse
from django.forms.models import modelform_factory from django.forms.models import modelform_factory

View File

@ -25,7 +25,7 @@
from datetime import date, timedelta from datetime import date, timedelta
from django.db import models from django.db import models
from django.utils import timezone from django.utils import timezone
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.conf import settings from django.conf import settings
from django.core.exceptions import ValidationError from django.core.exceptions import ValidationError
from django.urls import reverse from django.urls import reverse

View File

@ -23,7 +23,7 @@
# #
from django.views.generic.edit import CreateView, FormView from django.views.generic.edit import CreateView, FormView
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.core.exceptions import PermissionDenied, ValidationError from django.core.exceptions import PermissionDenied, ValidationError
from django.urls import reverse_lazy from django.urls import reverse_lazy
from django import forms from django import forms

View File

@ -23,7 +23,7 @@
# #
from django.db import models from django.db import models
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.urls import reverse from django.urls import reverse
from django.conf import settings from django.conf import settings
from django.core.exceptions import ValidationError from django.core.exceptions import ValidationError

View File

@ -28,7 +28,7 @@ from django.shortcuts import get_object_or_404, redirect
from django.urls import reverse_lazy, reverse from django.urls import reverse_lazy, reverse
from django.views.generic import DetailView, RedirectView, TemplateView, View from django.views.generic import DetailView, RedirectView, TemplateView, View
from django.views.generic.edit import UpdateView, CreateView, DeleteView from django.views.generic.edit import UpdateView, CreateView, DeleteView
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django import forms from django import forms
from django.conf import settings from django.conf import settings
from django.forms.models import modelform_factory from django.forms.models import modelform_factory