Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CC-2138 NZSL Upgrade Django 3.2.25 > 4.2 #170

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
69 changes: 40 additions & 29 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repository = "https://github.com/ODNZSL/NZSL-signbank"

[tool.poetry.dependencies]
python = "^3.9"
django = "~3.2.25"
django = "~4.2.13"
django-bootstrap3 = "*"
django-contrib-comments = "*"
django-debug-toolbar = "*"
Expand Down
4 changes: 2 additions & 2 deletions signbank/comments.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
from django.forms import ModelForm
from django.forms.models import model_to_dict
from django.http import HttpResponseForbidden
from django.utils.translation import ugettext as _
from django.utils.translation import ugettext_lazy as _lazy
from django.utils.translation import gettext as _
from django.utils.translation import gettext_lazy as _lazy
from django.contrib.sites.shortcuts import get_current_site
from django.dispatch import receiver
from django.contrib.contenttypes.models import ContentType
Expand Down
2 changes: 1 addition & 1 deletion signbank/customregistration/forms.py
Original file line number Diff line number Diff line change
@@ -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_registration.forms import RegistrationFormTermsOfService

Expand Down
2 changes: 1 addition & 1 deletion signbank/customregistration/signals.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from django.dispatch import receiver
from django.contrib.auth.models import User
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _

from django_registration.signals import user_registered
from notifications.signals import notify
Expand Down
2 changes: 1 addition & 1 deletion signbank/dictionary/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from django.core.exceptions import ObjectDoesNotExist
from django.db import models
from django.forms import CheckboxSelectMultiple, ModelForm, Textarea
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _
from guardian.admin import GuardedModelAdmin
from modeltranslation.admin import TranslationAdmin as ModelTranslationAdmin
from reversion.admin import VersionAdmin
Expand Down
2 changes: 1 addition & 1 deletion signbank/dictionary/adminviews.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from django.template.loader import render_to_string
from django.urls import reverse
from django.utils.translation import get_language
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _
from django.views.generic.detail import DetailView
from django.views.generic.list import ListView
from django_comments.models import Comment
Expand Down
2 changes: 1 addition & 1 deletion signbank/dictionary/choicelists.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

__author__ = 'heilniem'

Expand Down
2 changes: 1 addition & 1 deletion signbank/dictionary/csv_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from django.http import HttpResponseRedirect
from django.shortcuts import render, reverse
from django.utils.timezone import get_current_timezone
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _
from django_comments.models import Comment
from guardian.shortcuts import get_objects_for_user, get_perms
from tagging.models import Tag, TaggedItem
Expand Down
2 changes: 1 addition & 1 deletion signbank/dictionary/delete.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from django.shortcuts import get_object_or_404
from django.core.exceptions import PermissionDenied
from django.contrib import messages
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _
from django.http import HttpResponse, HttpResponseForbidden, HttpResponseNotAllowed

from guardian.shortcuts import get_perms
Expand Down
2 changes: 1 addition & 1 deletion signbank/dictionary/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ObjectDoesNotExist
from django.db.utils import OperationalError, ProgrammingError
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
from tagging.models import Tag

from .models import (AllowedTags, Dataset, FieldChoice, Gloss, Lemma, GlossRelation,
Expand Down
2 changes: 1 addition & 1 deletion signbank/dictionary/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned
from django.db import OperationalError, models
from django.urls import reverse
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
from tagging.models import Tag
from tagging.registry import AlreadyRegistered, register as tagging_register

Expand Down
2 changes: 1 addition & 1 deletion signbank/dictionary/publicviews.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from django.db.models import Q, Prefetch
from django.db.models.functions import Substr, Upper
from django.templatetags.static import static
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _
from django.views.decorators.cache import cache_page
from django.shortcuts import get_object_or_404

Expand Down
2 changes: 1 addition & 1 deletion signbank/dictionary/templates/dictionary/paginate.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% if page_obj.paginator.num_pages > 1 %}
<ul class="pagination pagination-sm">
{% if page_obj.has_previous %}
<li><a href="?page={{ page_obj.previous_page_number }}{% for key,value in request.GET.items %}{% ifnotequal key 'page' %}&{{ key }}={{ value }}{% endifnotequal %}{% endfor %}">&laquo;</a></li>
<li><a href="?page={{ page_obj.previous_page_number }}{% for key,value in request.GET.items %}{% if key != 'page' %}&{{ key }}={{ value }}{% endif %}{% endfor %}">&laquo;</a></li>
{% endif %}
{% if page_obj.number > 10 %}
<li><a>...</a></li>
Expand Down
2 changes: 1 addition & 1 deletion signbank/dictionary/tools.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import json

from django.conf import settings
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _
from zipfile import ZipFile

from signbank.dictionary.models import Dataset, Gloss
Expand Down
2 changes: 1 addition & 1 deletion signbank/dictionary/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
HttpResponseForbidden, HttpResponseNotAllowed,
HttpResponseRedirect, HttpResponseServerError)
from django.shortcuts import get_object_or_404, redirect, render, reverse
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _
from guardian.shortcuts import get_perms
from tagging.models import Tag, TaggedItem

Expand Down
2 changes: 1 addition & 1 deletion signbank/dictionary/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from django.contrib.admin.views.decorators import user_passes_test
from django.core.exceptions import PermissionDenied
from django.urls import reverse, reverse_lazy
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _
from django.views.generic.list import ListView
from django.views.generic import FormView
from django.db.models import Q, F, Count, Case, Value, When, BooleanField
Expand Down
6 changes: 5 additions & 1 deletion signbank/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@
import sys

import dj_database_url
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _

# Workaround for an issue in django-tagging which seems to no longer be maintained
import django
from django.utils.encoding import smart_str
django.utils.encoding.smart_text = smart_str
jonholdsworth marked this conversation as resolved.
Show resolved Hide resolved

sentry_dsn = os.environ.get('SENTRY_DSN', '')

Expand Down
2 changes: 1 addition & 1 deletion signbank/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from django.db import connection
from django.urls import reverse
from django.core.mail import mail_admins
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _
from django.conf import settings

from signbank.dictionary.models import Gloss, Language, Translation, Keyword, Dataset, GlossRelation
Expand Down
4 changes: 2 additions & 2 deletions signbank/video/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

from django.contrib import admin
from django.db.models import Count
from django.utils.translation import ugettext as _
from django.utils.translation import ugettext_lazy as _lazy
from django.utils.translation import gettext as _
from django.utils.translation import gettext_lazy as _lazy

from .models import GlossVideo, GlossVideoToken

Expand Down
2 changes: 1 addition & 1 deletion signbank/video/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from __future__ import unicode_literals

from django import forms
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
from signbank.dictionary.models import Dataset, FieldChoice, Gloss

from .models import GlossVideo
Expand Down
2 changes: 1 addition & 1 deletion signbank/video/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from django.core.files.storage import FileSystemStorage
from django.db import models
from django.utils.module_loading import import_string
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
from storages.backends.s3boto3 import S3Boto3Storage


Expand Down
4 changes: 2 additions & 2 deletions signbank/video/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from django.http import HttpResponse, HttpResponseNotAllowed, HttpResponseNotFound
from django.shortcuts import get_object_or_404, redirect
from django.urls import reverse, reverse_lazy
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.list import ListView
from djqscsv import render_to_csv_response
Expand Down Expand Up @@ -287,7 +287,7 @@ def render_to_response(self, context, **response_kwargs):

def update_glossvideo(request):
"""Process the post request for updating a glossvideo."""
if request.is_ajax():
if request.META.get('HTTP_X_REQUESTED_WITH') == 'XMLHttpRequest':
# If request is AJAX, follow this procedure.
data = json.loads(request.body.decode('utf-8'))
if request.method == 'POST':
Expand Down
Loading