diff --git a/.gitignore b/.gitignore
index 45f266f8..511f5fbf 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,7 +5,6 @@ db.sqlite3
*__pycache__*
.DS_Store
pyrightconfig.json
-poetry.lock
dist/
.vscode/
env/
diff --git a/accounting/models.py b/accounting/models.py
index 54fcb437..285a615a 100644
--- a/accounting/models.py
+++ b/accounting/models.py
@@ -27,7 +27,7 @@ from django.core.exceptions import ValidationError
from django.core import validators
from django.db import models
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 phonenumber_field.modelfields import PhoneNumberField
diff --git a/accounting/views.py b/accounting/views.py
index 9f891a09..e3a0f83e 100644
--- a/accounting/views.py
+++ b/accounting/views.py
@@ -25,7 +25,7 @@
from django.views.generic import ListView, DetailView
from django.views.generic.edit import UpdateView, CreateView, DeleteView, FormView
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.core.exceptions import PermissionDenied, ValidationError
from django.forms import HiddenInput
diff --git a/club/forms.py b/club/forms.py
index 658b343f..a5f63ffe 100644
--- a/club/forms.py
+++ b/club/forms.py
@@ -25,7 +25,7 @@
from django.conf import settings
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
diff --git a/club/models.py b/club/models.py
index c4cc75c6..5adc5a53 100644
--- a/club/models.py
+++ b/club/models.py
@@ -26,7 +26,7 @@
from django.db import models
from django.core import validators
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.db import transaction
from django.urls import reverse
diff --git a/club/templates/club/mailing.jinja b/club/templates/club/mailing.jinja
index 7aa88eed..8a364295 100644
--- a/club/templates/club/mailing.jinja
+++ b/club/templates/club/mailing.jinja
@@ -45,7 +45,7 @@
{% for widget in form_mailing_removal.subwidgets %}
- {% set user = ms[widget.data.value][0] %}
+ {% set user = ms[widget.data.value.value][0] %}
{{ user.get_username }} |
{{ user.get_email }} |
diff --git a/club/tests.py b/club/tests.py
index 10ccde0c..63b48f47 100644
--- a/club/tests.py
+++ b/club/tests.py
@@ -25,7 +25,7 @@
from django.conf import settings
from django.test import TestCase
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.core.management import call_command
from django.core.exceptions import ValidationError, NON_FIELD_ERRORS
@@ -180,7 +180,7 @@ class ClubTest(TestCase):
)
self.assertTrue(response.status_code == 200)
self.assertTrue(
- "Vous n'avez pas la permission de faire cela"
+ "Vous n'avez pas la permission de faire cela"
in str(response.content)
)
diff --git a/club/views.py b/club/views.py
index 574e7b47..5c3d61df 100644
--- a/club/views.py
+++ b/club/views.py
@@ -39,8 +39,8 @@ from django.http import (
)
from django.urls import reverse, reverse_lazy
from django.utils import timezone
-from django.utils.translation import ugettext_lazy as _
-from django.utils.translation import ugettext as _t
+from django.utils.translation import gettext_lazy as _
+from django.utils.translation import gettext as _t
from django.core.exceptions import PermissionDenied, ValidationError, NON_FIELD_ERRORS
from django.core.paginator import Paginator, InvalidPage
from django.shortcuts import get_object_or_404, redirect
diff --git a/com/models.py b/com/models.py
index c5a83b3f..4ac365eb 100644
--- a/com/models.py
+++ b/com/models.py
@@ -26,11 +26,11 @@
from django.shortcuts import render
from django.db import models, transaction
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.urls import reverse
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.exceptions import ValidationError
diff --git a/com/tests.py b/com/tests.py
index d42a056e..e0ebfc69 100644
--- a/com/tests.py
+++ b/com/tests.py
@@ -27,7 +27,7 @@ from django.conf import settings
from django.urls import reverse
from django.core.management import call_command
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
@@ -40,8 +40,8 @@ class ComAlertTest(TestCase):
def test_page_is_working(self):
self.client.login(username="comunity", password="plop")
response = self.client.get(reverse("com:alert_edit"))
- self.assertNotEquals(response.status_code, 500)
- self.assertEquals(response.status_code, 200)
+ self.assertNotEqual(response.status_code, 500)
+ self.assertEqual(response.status_code, 200)
class ComInfoTest(TestCase):
@@ -51,8 +51,8 @@ class ComInfoTest(TestCase):
def test_page_is_working(self):
self.client.login(username="comunity", password="plop")
response = self.client.get(reverse("com:info_edit"))
- self.assertNotEquals(response.status_code, 500)
- self.assertEquals(response.status_code, 200)
+ self.assertNotEqual(response.status_code, 500)
+ self.assertEqual(response.status_code, 200)
class ComTest(TestCase):
diff --git a/com/views.py b/com/views.py
index 02ddb50d..1acf1ef2 100644
--- a/com/views.py
+++ b/com/views.py
@@ -28,7 +28,7 @@ from django.http import HttpResponseRedirect
from django.views.generic import ListView, DetailView, View
from django.views.generic.edit import UpdateView, CreateView, DeleteView
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.core.exceptions import ValidationError
from django.utils import timezone
diff --git a/core/__init__.py b/core/__init__.py
index e5fb0a2d..0ace29c4 100644
--- a/core/__init__.py
+++ b/core/__init__.py
@@ -21,5 +21,3 @@
# Place - Suite 330, Boston, MA 02111-1307, USA.
#
#
-
-default_app_config = "core.apps.SithConfig"
diff --git a/core/models.py b/core/models.py
index 4ead06ed..61f0f3c1 100644
--- a/core/models.py
+++ b/core/models.py
@@ -34,7 +34,7 @@ from django.contrib.auth.models import (
GroupManager as AuthGroupManager,
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.core import validators
from django.core.exceptions import ValidationError, PermissionDenied
diff --git a/core/scss/processor.py b/core/scss/processor.py
index 8a5c3334..6aa334f2 100644
--- a/core/scss/processor.py
+++ b/core/scss/processor.py
@@ -25,9 +25,9 @@
import os
import sass
+from urllib.parse import urljoin
from django.utils.encoding import force_bytes, iri_to_uri
from django.core.files.base import ContentFile
-from django.utils.six.moves.urllib.parse import urljoin
from django.templatetags.static import static
from django.conf import settings
from core.scss.storage import ScssFileStorage, find_file
diff --git a/core/tests.py b/core/tests.py
index cb0c986b..d1ebd6af 100644
--- a/core/tests.py
+++ b/core/tests.py
@@ -402,32 +402,32 @@ class UserToolsTest(TestCase):
def test_anonymous_user_unauthorized(self):
response = self.client.get(reverse("core:user_tools"))
- self.assertEquals(response.status_code, 403)
+ self.assertEqual(response.status_code, 403)
def test_page_is_working(self):
# Test for simple user
self.client.login(username="guy", password="plop")
response = self.client.get(reverse("core:user_tools"))
- self.assertNotEquals(response.status_code, 500)
- self.assertEquals(response.status_code, 200)
+ self.assertNotEqual(response.status_code, 500)
+ self.assertEqual(response.status_code, 200)
# Test for root
self.client.login(username="root", password="plop")
response = self.client.get(reverse("core:user_tools"))
- self.assertNotEquals(response.status_code, 500)
- self.assertEquals(response.status_code, 200)
+ self.assertNotEqual(response.status_code, 500)
+ self.assertEqual(response.status_code, 200)
# Test for skia
self.client.login(username="skia", password="plop")
response = self.client.get(reverse("core:user_tools"))
- self.assertNotEquals(response.status_code, 500)
- self.assertEquals(response.status_code, 200)
+ self.assertNotEqual(response.status_code, 500)
+ self.assertEqual(response.status_code, 200)
# Test for comunity
self.client.login(username="comunity", password="plop")
response = self.client.get(reverse("core:user_tools"))
- self.assertNotEquals(response.status_code, 500)
- self.assertEquals(response.status_code, 200)
+ self.assertNotEqual(response.status_code, 500)
+ self.assertEqual(response.status_code, 200)
# TODO: many tests on the pages:
diff --git a/core/urls.py b/core/urls.py
index c0441da5..1c2577fc 100644
--- a/core/urls.py
+++ b/core/urls.py
@@ -23,7 +23,7 @@
#
#
-from django.urls import re_path
+from django.urls import re_path, path
from core.views import *
@@ -60,8 +60,8 @@ urlpatterns = [
SithPasswordResetDoneView.as_view(),
name="password_reset_done",
),
- re_path(
- r"^reset/(?P[0-9A-Za-z_\-]+)/(?P[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$",
+ path(
+ r"reset///",
SithPasswordResetConfirmView.as_view(),
name="password_reset_confirm",
),
diff --git a/core/views/files.py b/core/views/files.py
index 60f7f7aa..09f117a7 100644
--- a/core/views/files.py
+++ b/core/views/files.py
@@ -29,7 +29,7 @@ from django.views.generic.edit import UpdateView, FormMixin, DeleteView
from django.views.generic.detail import SingleObjectMixin
from django.forms.models import modelform_factory
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 wsgiref.util import FileWrapper
from django.urls import reverse
@@ -147,7 +147,7 @@ class FileListView(ListView):
def get_context_data(self, **kwargs):
kwargs = super(FileListView, self).get_context_data(**kwargs)
kwargs["popup"] = ""
- if self.kwargs["popup"]:
+ if self.kwargs.get("popup") is not None:
kwargs["popup"] = "popup"
return kwargs
@@ -165,7 +165,7 @@ class FileEditView(CanEditMixin, UpdateView):
return modelform_factory(SithFile, fields=fields)
def get_success_url(self):
- if self.kwargs["popup"]:
+ if self.kwargs.get("popup") is not None:
return reverse(
"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):
kwargs = super(FileEditView, self).get_context_data(**kwargs)
kwargs["popup"] = ""
- if self.kwargs["popup"]:
+ if self.kwargs.get("popup") is not None:
kwargs["popup"] = "popup"
return kwargs
@@ -217,13 +217,13 @@ class FileEditPropView(CanEditPropMixin, UpdateView):
def get_success_url(self):
return reverse(
"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):
kwargs = super(FileEditPropView, self).get_context_data(**kwargs)
kwargs["popup"] = ""
- if self.kwargs["popup"]:
+ if self.kwargs.get("popup") is not None:
kwargs["popup"] = "popup"
return kwargs
@@ -301,14 +301,14 @@ class FileView(CanViewMixin, DetailView, FormMixin):
def get_success_url(self):
return reverse(
"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):
kwargs = super(FileView, self).get_context_data(**kwargs)
kwargs["popup"] = ""
kwargs["form"] = self.form
- if self.kwargs["popup"]:
+ if self.kwargs.get("popup") is not None:
kwargs["popup"] = "popup"
kwargs["clipboard"] = SithFile.objects.filter(
id__in=self.request.session["clipboard"]
@@ -328,20 +328,20 @@ class FileDeleteView(CanEditPropMixin, DeleteView):
return self.request.GET["next"]
if self.object.parent is None:
return reverse(
- "core:file_list", kwargs={"popup": self.kwargs["popup"] or ""}
+ "core:file_list", kwargs={"popup": self.kwargs.get("popup", "")}
)
return reverse(
"core:file_detail",
kwargs={
"file_id": self.object.parent.id,
- "popup": self.kwargs["popup"] or "",
+ "popup": self.kwargs.get("popup", ""),
},
)
def get_context_data(self, **kwargs):
kwargs = super(FileDeleteView, self).get_context_data(**kwargs)
kwargs["popup"] = ""
- if self.kwargs["popup"]:
+ if self.kwargs.get("popup") is not None:
kwargs["popup"] = "popup"
return kwargs
diff --git a/core/views/forms.py b/core/views/forms.py
index 18081e01..9359cd28 100644
--- a/core/views/forms.py
+++ b/core/views/forms.py
@@ -37,8 +37,8 @@ from django.forms import (
DateTimeInput,
Textarea,
)
-from django.utils.translation import ugettext_lazy as _
-from django.utils.translation import ugettext
+from django.utils.translation import gettext_lazy as _
+from django.utils.translation import gettext
from phonenumber_field.widgets import PhoneNumberInternationalFallbackWidget
from ajax_select.fields import AutoCompleteSelectField
from ajax_select import make_ajax_field
@@ -130,7 +130,7 @@ class SelectFile(TextInput):
''
- + ugettext("Choose file")
+ + gettext("Choose file")
+ ""
)
return output
@@ -154,7 +154,7 @@ class SelectUser(TextInput):
''
- + ugettext("Choose user")
+ + gettext("Choose user")
+ ""
)
return output
diff --git a/core/views/group.py b/core/views/group.py
index fa394174..662f257e 100644
--- a/core/views/group.py
+++ b/core/views/group.py
@@ -31,7 +31,7 @@ from django.views.generic import ListView
from django.views.generic.edit import FormView
from django.urls import reverse_lazy
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 ajax_select.fields import AutoCompleteSelectMultipleField
diff --git a/core/views/user.py b/core/views/user.py
index aea3de60..ffd867ad 100644
--- a/core/views/user.py
+++ b/core/views/user.py
@@ -27,7 +27,7 @@
from django.shortcuts import render, redirect, get_object_or_404
from django.contrib.auth import views
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.core.exceptions import PermissionDenied, ValidationError
from django.http import Http404, HttpResponse
diff --git a/counter/__init__.py b/counter/__init__.py
index 584960bd..5d5acce0 100644
--- a/counter/__init__.py
+++ b/counter/__init__.py
@@ -22,5 +22,3 @@
# Place - Suite 330, Boston, MA 02111-1307, USA.
#
#
-
-default_app_config = "counter.app.CounterConfig"
diff --git a/counter/app.py b/counter/app.py
index 1e60276c..c1feefe2 100644
--- a/counter/app.py
+++ b/counter/app.py
@@ -23,7 +23,7 @@
#
from django.apps import AppConfig
-from django.utils.translation import ugettext_lazy as _
+from django.utils.translation import gettext_lazy as _
class CounterConfig(AppConfig):
diff --git a/counter/migrations/0013_customer_recorded_products.py b/counter/migrations/0013_customer_recorded_products.py
index 84f5caf5..80f6d94d 100644
--- a/counter/migrations/0013_customer_recorded_products.py
+++ b/counter/migrations/0013_customer_recorded_products.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
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.conf import settings
diff --git a/counter/models.py b/counter/models.py
index 064656b3..8523555c 100644
--- a/counter/models.py
+++ b/counter/models.py
@@ -24,7 +24,7 @@
from sith.settings import SITH_COUNTER_OFFICES, SITH_MAIN_CLUB
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.conf import settings
from django.urls import reverse
diff --git a/counter/tests.py b/counter/tests.py
index 70f75b06..ac82fcbb 100644
--- a/counter/tests.py
+++ b/counter/tests.py
@@ -110,6 +110,7 @@ class CounterTest(TestCase):
"bank": "OTHER",
},
)
+ self.assertTrue(response.status_code == 200)
response = self.client.post(
reverse("counter:login", kwargs={"counter_id": self.foyer.id}),
@@ -139,7 +140,7 @@ class CounterTest(TestCase):
"bank": "OTHER",
},
)
- self.assertTrue(response.status_code == 403)
+ self.assertTrue(response.status_code == 200)
class CounterStatsTest(TestCase):
diff --git a/counter/views.py b/counter/views.py
index ff2ed6b1..b819322e 100644
--- a/counter/views.py
+++ b/counter/views.py
@@ -41,7 +41,7 @@ from django.urls import reverse_lazy, reverse
from django.http import HttpResponseRedirect, HttpResponse, JsonResponse
from django.utils import timezone
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.db import DataError, transaction, models
diff --git a/doc/frequent/subscriptions.rst b/doc/frequent/subscriptions.rst
index b73c5de1..c151b35a 100644
--- a/doc/frequent/subscriptions.rst
+++ b/doc/frequent/subscriptions.rst
@@ -12,7 +12,7 @@ Pour modifier les cotisations disponnibles, tout se gère dans la configuration
.. code-block:: python
- from django.utils.translation import ugettext_lazy as _
+ from django.utils.translation import gettext_lazy as _
SITH_SUBSCRIPTIONS = {
# Voici un échantillon de la véritable configuration à l'heure de l'écriture.
diff --git a/doc/overlay/rights.rst b/doc/overlay/rights.rst
index a7e34e56..1e03f536 100644
--- a/doc/overlay/rights.rst
+++ b/doc/overlay/rights.rst
@@ -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.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.models import User, Group
@@ -63,7 +63,7 @@ Voici maintenant comment faire en définissant des fonctions personnalisées. Ce
.. code-block:: python
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.models import User, Group
diff --git a/doc/start/translations.rst b/doc/start/translations.rst
index 76aa1c6e..a854518d 100644
--- a/doc/start/translations.rst
+++ b/doc/start/translations.rst
@@ -14,7 +14,7 @@ Si le mot est dans le code Python :
.. sourcecode:: python
- from django.utils.translation import ugettext_lazy as _
+ from django.utils.translation import gettext_lazy as _
# ...
diff --git a/eboutic/models.py b/eboutic/models.py
index 4d43ce26..b69f70c0 100644
--- a/eboutic/models.py
+++ b/eboutic/models.py
@@ -23,7 +23,7 @@
#
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.conf import settings
diff --git a/eboutic/tests.py b/eboutic/tests.py
index 9d0bf2de..6435f49b 100644
--- a/eboutic/tests.py
+++ b/eboutic/tests.py
@@ -59,7 +59,7 @@ class EbouticTest(TestCase):
with open("./eboutic/tests/public_key.pem") as f:
settings.SITH_EBOUTIC_PUB_KEY = f.read()
privkey = crypto.load_privatekey(crypto.FILETYPE_PEM, PRIVKEY)
- sig = crypto.sign(privkey, query, "sha1")
+ sig = crypto.sign(privkey, query.encode("utf-8"), "sha1")
b64sig = base64.b64encode(sig).decode("ascii")
url = reverse("eboutic:etransation_autoanswer") + "?%s&Sig=%s" % (
diff --git a/eboutic/tests/test.py b/eboutic/tests/test.py
index 83a14ad9..2a4e6cfb 100755
--- a/eboutic/tests/test.py
+++ b/eboutic/tests/test.py
@@ -14,11 +14,11 @@ with open("./private_key.pem") as f:
with open("./public_key.pem") as f:
PUBKEY = f.read()
-string = "Amount=400&BasketID=4000&Auto=42&Error=00000\n"
+data = "Amount=400&BasketID=4000&Auto=42&Error=00000\n".encode("utf-8")
# Sign
prvkey = crypto.load_privatekey(crypto.FILETYPE_PEM, PRVKEY)
-sig = crypto.sign(prvkey, string, "sha1")
+sig = crypto.sign(prvkey, data, "sha1")
b64sig = base64.b64encode(sig)
print(b64sig)
@@ -28,7 +28,7 @@ cert = crypto.X509()
cert.set_pubkey(pubkey)
sig = base64.b64decode(b64sig)
try:
- crypto.verify(cert, sig, string, "sha1")
+ crypto.verify(cert, sig, data, "sha1")
print("Verify OK")
except:
print("Verify failed")
diff --git a/eboutic/views.py b/eboutic/views.py
index abac99ef..3f2ef6cb 100644
--- a/eboutic/views.py
+++ b/eboutic/views.py
@@ -33,7 +33,7 @@ from django.views.generic import TemplateView, View
from django.http import HttpResponse, HttpResponseRedirect
from django.core.exceptions import SuspiciousOperation
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 counter.models import Customer, Counter, ProductType, Selling
@@ -264,7 +264,7 @@ class EtransactionAutoAnswer(View):
crypto.verify(
cert,
sig,
- "&".join(request.META["QUERY_STRING"].split("&")[:-1]),
+ "&".join(request.META["QUERY_STRING"].split("&")[:-1]).encode("utf-8"),
"sha1",
)
except:
diff --git a/election/models.py b/election/models.py
index 3289c11c..537cc6e9 100644
--- a/election/models.py
+++ b/election/models.py
@@ -1,6 +1,6 @@
from django.db import models
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 core.models import User, Group
diff --git a/election/views.py b/election/views.py
index ad0cdb3e..f36482fa 100644
--- a/election/views.py
+++ b/election/views.py
@@ -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 DeleteView, FormView
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.db import transaction
from django.forms import CheckboxSelectMultiple
diff --git a/forum/models.py b/forum/models.py
index d8fefd35..dd8722e9 100644
--- a/forum/models.py
+++ b/forum/models.py
@@ -24,7 +24,7 @@
from django.db import models
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.urls import reverse
from django.utils import timezone
diff --git a/forum/views.py b/forum/views.py
index 9a2f443b..9b75794b 100644
--- a/forum/views.py
+++ b/forum/views.py
@@ -27,7 +27,7 @@ from django.shortcuts import get_object_or_404
from django.views.generic import ListView, DetailView, RedirectView
from django.views.generic.edit import UpdateView, CreateView, DeleteView
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.utils import timezone, html
from django.conf import settings
diff --git a/launderette/models.py b/launderette/models.py
index 14cd4f77..795dd908 100644
--- a/launderette/models.py
+++ b/launderette/models.py
@@ -23,7 +23,7 @@
#
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.urls import reverse
diff --git a/launderette/views.py b/launderette/views.py
index a7672102..0387c3d3 100644
--- a/launderette/views.py
+++ b/launderette/views.py
@@ -28,7 +28,7 @@ import pytz
from django.views.generic import ListView, DetailView, TemplateView
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.urls import reverse_lazy
from django.conf import settings
diff --git a/matmat/views.py b/matmat/views.py
index a2d8fff9..10b2d4f5 100644
--- a/matmat/views.py
+++ b/matmat/views.py
@@ -26,7 +26,7 @@ from enum import Enum
from django.views.generic import ListView, View
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.http.response import HttpResponseRedirect
from django.urls import reverse
diff --git a/pedagogy/forms.py b/pedagogy/forms.py
index 3e0b4fb7..6a3d29ce 100644
--- a/pedagogy/forms.py
+++ b/pedagogy/forms.py
@@ -23,7 +23,7 @@
#
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.templatetags.static import static
diff --git a/pedagogy/models.py b/pedagogy/models.py
index f3a8139f..5fa21096 100644
--- a/pedagogy/models.py
+++ b/pedagogy/models.py
@@ -23,7 +23,7 @@
#
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.core import validators
from django.conf import settings
diff --git a/pedagogy/templates/pedagogy/moderation.jinja b/pedagogy/templates/pedagogy/moderation.jinja
index 61a2a617..95367858 100644
--- a/pedagogy/templates/pedagogy/moderation.jinja
+++ b/pedagogy/templates/pedagogy/moderation.jinja
@@ -18,7 +18,7 @@
{% set queryset = form.accepted_reports.field.queryset %}
{% for widget in form.accepted_reports.subwidgets %}
- {% set report = queryset.get(id=widget.data.value) %}
+ {% set report = queryset.get(id=widget.data.value.value) %}