From 08e687e53ba84afd39646185142e59c6bfe77783 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Thu, 6 Oct 2022 14:49:21 +0200 Subject: [PATCH] Upgrades --- requirements/requirements.txt | 8 ++++---- src/ajaxable/utils.py | 2 +- src/annoy/models.py | 2 +- src/annoy/places.py | 2 +- src/api/models.py | 2 +- src/catalogue/constants.py | 2 +- src/catalogue/forms.py | 2 +- src/catalogue/models/book.py | 2 +- src/catalogue/models/bookmedia.py | 2 +- src/catalogue/models/collection.py | 2 +- src/catalogue/models/fragment.py | 2 +- src/catalogue/models/source.py | 2 +- src/catalogue/models/tag.py | 4 ++-- src/catalogue/templatetags/catalogue_tags.py | 2 +- src/catalogue/views.py | 6 +++--- src/chunks/models.py | 2 +- src/club/apps.py | 2 +- src/club/forms.py | 2 +- src/club/models.py | 2 +- src/club/payu/models.py | 2 +- src/dictionary/constants.py | 2 +- src/funding/admin.py | 2 +- src/funding/forms.py | 6 +++--- src/funding/models.py | 2 +- src/infopages/models.py | 2 +- src/isbn/forms.py | 2 +- src/lesmianator/models.py | 2 +- src/libraries/models.py | 2 +- src/messaging/admin.py | 2 +- src/messaging/models.py | 2 +- src/messaging/states.py | 2 +- src/messaging/views.py | 2 +- src/newsletter/forms.py | 2 +- src/newsletter/models.py | 2 +- src/newsletter/views.py | 2 +- src/newtagging/models.py | 2 +- src/paypal/forms.py | 2 +- src/pdcounter/models.py | 2 +- src/picture/forms.py | 2 +- src/picture/models.py | 2 +- src/picture/views.py | 2 +- src/polls/models.py | 2 +- src/push/models.py | 2 +- src/pz/bank.py | 2 +- src/pz/migrations/0012_auto_20221006_1431.py | 18 ++++++++++++++++++ src/pz/models.py | 4 ++-- src/search/forms.py | 2 +- src/social/admin.py | 2 +- src/social/forms.py | 2 +- src/social/models.py | 2 +- src/sponsors/models.py | 2 +- src/suggest/forms.py | 14 +++++++------- src/suggest/models.py | 2 +- src/suggest/views.py | 2 +- src/wolnelektury/settings/basic.py | 2 ++ src/wolnelektury/views.py | 2 +- 56 files changed, 89 insertions(+), 69 deletions(-) create mode 100644 src/pz/migrations/0012_auto_20221006_1431.py diff --git a/requirements/requirements.txt b/requirements/requirements.txt index fa2d53183..9f2340da3 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -1,7 +1,7 @@ -i https://py.mdrn.pl/simple/ # django -Django==2.2.28 +Django==3.2.16 fnpdjango==0.6 docutils==0.16 @@ -12,14 +12,14 @@ jsmin==3.0.1 fnp-django-pagination==2.2.5 django-modeltranslation==0.18.2 django-allauth==0.51 -django-extensions==3.1.1 +django-extensions==3.1.5 djangorestframework==3.13.1 djangorestframework-xml==2.0.0 django-admin-ordering==0.14.0 django-machina==1.1.6 django-countries==7.3.2 -# A version compatible with Django 2.2, with long help text and editable max_length. +# A version compatible with Django 2.2+, with long help text and editable max_length. -e git+https://github.com/rczajka/django-forms-builder@6bdb2345cfc02ebf7e0fb049e43e4e0a38b52940#egg=django-forms-builder @@ -41,7 +41,7 @@ Feedparser==6.0.10 Pillow==9.2.0 mutagen==1.45.1 -sorl-thumbnail==12.7.0 +sorl-thumbnail==12.8.0 # home-brewed & dependencies librarian==2.4.1 diff --git a/src/ajaxable/utils.py b/src/ajaxable/utils.py index f8e99cece..23a350f5f 100644 --- a/src/ajaxable/utils.py +++ b/src/ajaxable/utils.py @@ -9,7 +9,7 @@ from django.shortcuts import render from django.utils.encoding import force_text from django.utils.functional import Promise from django.utils.http import urlquote_plus -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from django.views.decorators.vary import vary_on_headers from honeypot.decorators import verify_honeypot_value diff --git a/src/annoy/models.py b/src/annoy/models.py index 5a613f1e0..c8fdf2dad 100644 --- a/src/annoy/models.py +++ b/src/annoy/models.py @@ -2,7 +2,7 @@ from django.apps import apps from django.conf import settings from django.db import models from django.template import Context, Template -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from django.utils.timezone import now from .places import PLACES, PLACE_CHOICES, STYLES diff --git a/src/annoy/places.py b/src/annoy/places.py index 7663a6105..adcf3dcc6 100644 --- a/src/annoy/places.py +++ b/src/annoy/places.py @@ -1,4 +1,4 @@ -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ PLACE_DEFINITIONS = [ ('top', _('Top of all pages.'), True), diff --git a/src/api/models.py b/src/api/models.py index 28bc8807d..eb234ad8b 100644 --- a/src/api/models.py +++ b/src/api/models.py @@ -6,7 +6,7 @@ from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType from django.db import models from django.db.models.signals import pre_delete -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from catalogue.models import Book, Tag diff --git a/src/catalogue/constants.py b/src/catalogue/constants.py index 6925880a1..6ee7c97ab 100644 --- a/src/catalogue/constants.py +++ b/src/catalogue/constants.py @@ -1,7 +1,7 @@ # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ LICENSES = { 'http://creativecommons.org/licenses/by-sa/3.0/': { diff --git a/src/catalogue/forms.py b/src/catalogue/forms.py index 0e5b4d10e..f124f3170 100644 --- a/src/catalogue/forms.py +++ b/src/catalogue/forms.py @@ -2,7 +2,7 @@ # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # from django import forms -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from catalogue.models import Book from waiter.models import WaitedFile diff --git a/src/catalogue/models/book.py b/src/catalogue/models/book.py index fc07fc5f7..c03f7a3d0 100644 --- a/src/catalogue/models/book.py +++ b/src/catalogue/models/book.py @@ -15,7 +15,7 @@ import django.dispatch from django.contrib.contenttypes.fields import GenericRelation from django.template.loader import render_to_string from django.urls import reverse -from django.utils.translation import ugettext_lazy as _, get_language +from django.utils.translation import gettext_lazy as _, get_language from fnpdjango.storage import BofhFileSystemStorage from lxml import html from librarian.cover import WLCover diff --git a/src/catalogue/models/bookmedia.py b/src/catalogue/models/bookmedia.py index 541940561..dc02d615d 100644 --- a/src/catalogue/models/bookmedia.py +++ b/src/catalogue/models/bookmedia.py @@ -5,7 +5,7 @@ from collections import OrderedDict import json from collections import namedtuple from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from slugify import slugify import mutagen from mutagen import id3 diff --git a/src/catalogue/models/collection.py b/src/catalogue/models/collection.py index 6f956c73e..2f64b79de 100644 --- a/src/catalogue/models/collection.py +++ b/src/catalogue/models/collection.py @@ -4,7 +4,7 @@ from django.conf import settings from django.db import models from django.urls import reverse -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ import re from wolnelektury.utils import cached_render, clear_cached_renders diff --git a/src/catalogue/models/fragment.py b/src/catalogue/models/fragment.py index ac0c53908..9ee48c92d 100644 --- a/src/catalogue/models/fragment.py +++ b/src/catalogue/models/fragment.py @@ -5,7 +5,7 @@ from django.conf import settings from django.contrib.contenttypes.fields import GenericRelation from django.urls import reverse from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from newtagging import managers from catalogue.models import Tag from wolnelektury.utils import cached_render, clear_cached_renders diff --git a/src/catalogue/models/source.py b/src/catalogue/models/source.py index 77b1a677b..ee024e0e6 100644 --- a/src/catalogue/models/source.py +++ b/src/catalogue/models/source.py @@ -2,7 +2,7 @@ # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ class Source(models.Model): diff --git a/src/catalogue/models/tag.py b/src/catalogue/models/tag.py index acf02529e..740b84bac 100644 --- a/src/catalogue/models/tag.py +++ b/src/catalogue/models/tag.py @@ -11,7 +11,7 @@ from django.db import models from django.db.models.query import Prefetch from django.dispatch import Signal from django.urls import reverse -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from newtagging.models import TagManager, TaggedItemManager @@ -73,7 +73,7 @@ class Tag(models.Model): created_at = models.DateTimeField(_('creation date'), auto_now_add=True, db_index=True) changed_at = models.DateTimeField(_('creation date'), auto_now=True, db_index=True) - after_change = Signal(providing_args=['instance']) + after_change = Signal() intermediary_table_model = TagRelation objects = TagManager() diff --git a/src/catalogue/templatetags/catalogue_tags.py b/src/catalogue/templatetags/catalogue_tags.py index cddd273e1..24210b821 100644 --- a/src/catalogue/templatetags/catalogue_tags.py +++ b/src/catalogue/templatetags/catalogue_tags.py @@ -11,7 +11,7 @@ from django.template import Node, Variable, Template, Context from django.urls import reverse from django.utils.cache import add_never_cache_headers from django.utils.safestring import mark_safe -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from catalogue.helpers import get_audiobook_tags from catalogue.models import Book, BookMedia, Fragment, Tag, Source diff --git a/src/catalogue/views.py b/src/catalogue/views.py index 816836d64..5a32932a3 100644 --- a/src/catalogue/views.py +++ b/src/catalogue/views.py @@ -14,7 +14,7 @@ from django.db.models import Q, QuerySet from django.contrib.auth.decorators import login_required, user_passes_test from django.utils.http import urlquote_plus from django.utils import translation -from django.utils.translation import ugettext as _, ugettext_lazy +from django.utils.translation import gettext as _, gettext_lazy from django.views.decorators.cache import never_cache from ajaxable.utils import AjaxableFormView @@ -421,8 +421,8 @@ def download_zip(request, file_format=None, media_format=None, slug=None): class CustomPDFFormView(AjaxableFormView): form_class = forms.CustomPDFForm - title = ugettext_lazy('Download custom PDF') - submit = ugettext_lazy('Download') + title = gettext_lazy('Download custom PDF') + submit = gettext_lazy('Download') template = 'catalogue/custom_pdf_form.html' honeypot = True diff --git a/src/chunks/models.py b/src/chunks/models.py index 881cc529f..e1ed94db4 100644 --- a/src/chunks/models.py +++ b/src/chunks/models.py @@ -6,7 +6,7 @@ from django.core.cache import cache from django.db import models from django.urls import reverse from django.utils.safestring import mark_safe -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ class Chunk(models.Model): diff --git a/src/club/apps.py b/src/club/apps.py index 44a257ce0..6da6c0824 100644 --- a/src/club/apps.py +++ b/src/club/apps.py @@ -2,7 +2,7 @@ # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # from django.apps import AppConfig -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ class ClubConfig(AppConfig): diff --git a/src/club/forms.py b/src/club/forms.py index 2347e2a61..75213fc44 100644 --- a/src/club/forms.py +++ b/src/club/forms.py @@ -3,7 +3,7 @@ # from decimal import Decimal from django import forms -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from newsletter.forms import NewsletterForm from . import models, payment_methods from .payu.forms import CardTokenForm diff --git a/src/club/models.py b/src/club/models.py index b5df04113..1a78d761c 100644 --- a/src/club/models.py +++ b/src/club/models.py @@ -12,7 +12,7 @@ from django.urls import reverse from django.db import models from django import template from django.utils.timezone import now -from django.utils.translation import ugettext_lazy as _, ungettext, ugettext, get_language +from django.utils.translation import gettext_lazy as _, ngettext, gettext, get_language from django_countries.fields import CountryField from pytz import utc from catalogue.utils import get_random_hash diff --git a/src/club/payu/models.py b/src/club/payu/models.py index 937d32aa6..b025bfc72 100644 --- a/src/club/payu/models.py +++ b/src/club/payu/models.py @@ -8,7 +8,7 @@ from django.contrib.sites.models import Site from django.db import models from django.urls import reverse from django.utils.timezone import now -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from . import POSS diff --git a/src/dictionary/constants.py b/src/dictionary/constants.py index 51fc67b11..bc19ed79a 100644 --- a/src/dictionary/constants.py +++ b/src/dictionary/constants.py @@ -1,7 +1,7 @@ # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ FN_TYPES = { diff --git a/src/funding/admin.py b/src/funding/admin.py index 47bc98a02..6f29fbc83 100644 --- a/src/funding/admin.py +++ b/src/funding/admin.py @@ -1,7 +1,7 @@ # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from django.contrib import admin from modeltranslation.admin import TranslationAdmin from fnpdjango.actions import export_as_csv_action diff --git a/src/funding/forms.py b/src/funding/forms.py index 22d1a3092..e055faf93 100644 --- a/src/funding/forms.py +++ b/src/funding/forms.py @@ -4,7 +4,7 @@ from django import forms from django.utils import formats from django.utils.safestring import mark_safe -from django.utils.translation import ugettext_lazy as _, ugettext, get_language +from django.utils.translation import gettext_lazy as _, gettext, get_language from newsletter.forms import NewsletterForm from club.payment_methods import PayU @@ -46,13 +46,13 @@ adres e-mail zostanie wykorzystany także w celu przesyłania newslettera Wolnyc if isinstance(min_amount, float): min_amount = formats.number_format(min_amount, 2) raise forms.ValidationError( - ugettext("The minimum amount is %(amount)s PLN.") % { + gettext("The minimum amount is %(amount)s PLN.") % { 'amount': min_amount}) return self.cleaned_data['amount'] def clean(self): if not self.offer.is_current(): - raise forms.ValidationError(ugettext("This offer is out of date.")) + raise forms.ValidationError(gettext("This offer is out of date.")) return self.cleaned_data def save(self): diff --git a/src/funding/models.py b/src/funding/models.py index 8dbc7111a..838d2ab35 100644 --- a/src/funding/models.py +++ b/src/funding/models.py @@ -12,7 +12,7 @@ from django.template.loader import render_to_string from django.urls import reverse from django.utils.html import mark_safe from django.utils.timezone import utc -from django.utils.translation import ugettext_lazy as _, override +from django.utils.translation import gettext_lazy as _, override from catalogue.models import Book from catalogue.utils import get_random_hash from polls.models import Poll diff --git a/src/infopages/models.py b/src/infopages/models.py index 0060a7036..e6e4eb7cd 100644 --- a/src/infopages/models.py +++ b/src/infopages/models.py @@ -3,7 +3,7 @@ # from django.db import models from django.urls import reverse -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ class InfoPage(models.Model): diff --git a/src/isbn/forms.py b/src/isbn/forms.py index 7d47fb5be..f513bd522 100644 --- a/src/isbn/forms.py +++ b/src/isbn/forms.py @@ -6,7 +6,7 @@ import json from urllib.request import urlopen from django import forms -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from slugify import slugify from isbn.management.commands.import_onix import UNKNOWN diff --git a/src/lesmianator/models.py b/src/lesmianator/models.py index 9e2f1669e..28dbdba90 100644 --- a/src/lesmianator/models.py +++ b/src/lesmianator/models.py @@ -10,7 +10,7 @@ from random import randint from django.core.files.base import ContentFile from django.db import models from django.utils.timezone import utc -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.fields import GenericForeignKey diff --git a/src/libraries/models.py b/src/libraries/models.py index 3e80301e7..56e9b2d4f 100644 --- a/src/libraries/models.py +++ b/src/libraries/models.py @@ -3,7 +3,7 @@ # from django.db import models from django.urls import reverse -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ class Catalog(models.Model): diff --git a/src/messaging/admin.py b/src/messaging/admin.py index e01adac18..06ed21202 100644 --- a/src/messaging/admin.py +++ b/src/messaging/admin.py @@ -1,6 +1,6 @@ from django.contrib import admin from django.contrib import messages -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from fnpdjango.actions import export_as_csv_action from . import models diff --git a/src/messaging/models.py b/src/messaging/models.py index 7891e0c63..e1b26a8a0 100644 --- a/src/messaging/models.py +++ b/src/messaging/models.py @@ -6,7 +6,7 @@ from django.db import models from django.template import Template, Context from django.urls import reverse from django.utils.timezone import now, get_current_timezone -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from sentry_sdk import capture_exception from catalogue.utils import get_random_hash from .states import Level, states diff --git a/src/messaging/states.py b/src/messaging/states.py index 4105caf5a..144d842b0 100644 --- a/src/messaging/states.py +++ b/src/messaging/states.py @@ -1,7 +1,7 @@ from datetime import timedelta from django.apps import apps from django.utils.timezone import now -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ class Level: diff --git a/src/messaging/views.py b/src/messaging/views.py index fc09d72c4..429031387 100644 --- a/src/messaging/views.py +++ b/src/messaging/views.py @@ -2,7 +2,7 @@ import json from django.http import JsonResponse from django.urls import reverse from django.shortcuts import render -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from django.views.decorators import cache from django.views.generic import DetailView, UpdateView from . import models diff --git a/src/newsletter/forms.py b/src/newsletter/forms.py index 3f08668ea..47606a57f 100644 --- a/src/newsletter/forms.py +++ b/src/newsletter/forms.py @@ -6,7 +6,7 @@ from django.core.validators import validate_email from django.forms import Form, BooleanField from django.forms.fields import EmailField from django.utils.safestring import mark_safe -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from newsletter.subscribe import subscribe from .models import Newsletter diff --git a/src/newsletter/models.py b/src/newsletter/models.py index dc28e3d10..86e1a0d4d 100644 --- a/src/newsletter/models.py +++ b/src/newsletter/models.py @@ -4,7 +4,7 @@ import hashlib from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from django.conf import settings diff --git a/src/newsletter/views.py b/src/newsletter/views.py index 3440a47b7..fcb9d3c80 100644 --- a/src/newsletter/views.py +++ b/src/newsletter/views.py @@ -4,7 +4,7 @@ from django.http.response import HttpResponseRedirect from django.shortcuts import render, get_object_or_404 from django.urls import reverse -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from newsletter.forms import SubscribeForm, Newsletter diff --git a/src/newtagging/models.py b/src/newtagging/models.py index e3e8f3c0a..84149cc82 100644 --- a/src/newtagging/models.py +++ b/src/newtagging/models.py @@ -12,7 +12,7 @@ from django.dispatch import Signal qn = connection.ops.quote_name -tags_updated = Signal(providing_args=["affected_tags"]) +tags_updated = Signal() def get_queryset_and_model(queryset_or_model): diff --git a/src/paypal/forms.py b/src/paypal/forms.py index f35219aa8..cadea3f3f 100644 --- a/src/paypal/forms.py +++ b/src/paypal/forms.py @@ -2,7 +2,7 @@ # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # from django import forms -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ class PaypalSubscriptionForm(forms.Form): diff --git a/src/pdcounter/models.py b/src/pdcounter/models.py index 40bf3e69a..3ce7f72ce 100644 --- a/src/pdcounter/models.py +++ b/src/pdcounter/models.py @@ -4,7 +4,7 @@ from django.conf import settings from django.db import models from django.urls import reverse -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from datetime import datetime from django.db.models.signals import post_save, post_delete diff --git a/src/picture/forms.py b/src/picture/forms.py index 47156e8f8..0c0304127 100644 --- a/src/picture/forms.py +++ b/src/picture/forms.py @@ -2,7 +2,7 @@ # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # from django import forms -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from picture.models import Picture diff --git a/src/picture/models.py b/src/picture/models.py index 7ccd97c0c..5f5fe4c58 100644 --- a/src/picture/models.py +++ b/src/picture/models.py @@ -22,7 +22,7 @@ import re from PIL import Image -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from newtagging import managers from os import path diff --git a/src/picture/views.py b/src/picture/views.py index e40e0ab41..27f9050fe 100644 --- a/src/picture/views.py +++ b/src/picture/views.py @@ -81,7 +81,7 @@ def import_picture(request): """docstring for import_book""" from django.http import HttpResponse from picture.forms import PictureImportForm - from django.utils.translation import ugettext as _ + from django.utils.translation import gettext as _ import_form = PictureImportForm(request.POST, request.FILES) if import_form.is_valid(): diff --git a/src/polls/models.py b/src/polls/models.py index 2785f353e..ddf4003f8 100644 --- a/src/polls/models.py +++ b/src/polls/models.py @@ -2,7 +2,7 @@ # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # from django.db import models -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 diff --git a/src/push/models.py b/src/push/models.py index b149ed760..54fd1a04b 100644 --- a/src/push/models.py +++ b/src/push/models.py @@ -2,7 +2,7 @@ # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ class Notification(models.Model): diff --git a/src/pz/bank.py b/src/pz/bank.py index de22ac0c8..d5eef931f 100644 --- a/src/pz/bank.py +++ b/src/pz/bank.py @@ -4,7 +4,7 @@ from io import StringIO from django.conf import settings from django.http import HttpResponse from django.utils.safestring import mark_safe -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ def bank_export(modeladmin, request, queryset): diff --git a/src/pz/migrations/0012_auto_20221006_1431.py b/src/pz/migrations/0012_auto_20221006_1431.py new file mode 100644 index 000000000..b217376bd --- /dev/null +++ b/src/pz/migrations/0012_auto_20221006_1431.py @@ -0,0 +1,18 @@ +# Generated by Django 3.1.14 on 2022-10-06 12:31 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('pz', '0011_payment'), + ] + + operations = [ + migrations.AlterField( + model_name='directdebit', + name='iban_valid', + field=models.BooleanField(default=False, null=True, verbose_name='IBAN valid'), + ), + ] diff --git a/src/pz/models.py b/src/pz/models.py index c46608435..4bd3673d6 100644 --- a/src/pz/models.py +++ b/src/pz/models.py @@ -1,7 +1,7 @@ import re from django.db import models from django.utils.timezone import now -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from .bank import parse_export_feedback, parse_payment_feedback @@ -44,7 +44,7 @@ class DirectDebit(models.Model): phone = models.CharField(_('phone'), max_length=255, blank=True) email = models.CharField(_('e-mail'), max_length=255, blank=True) iban = models.CharField(_('IBAN'), max_length=255, blank=True) - iban_valid = models.NullBooleanField(_('IBAN valid'), default=False) + iban_valid = models.BooleanField(_('IBAN valid'), default=False, null=True) is_consumer = models.BooleanField(_('is a consumer'), default=True) payment_id = models.CharField(_('payment identifier'), max_length=255, blank=True, unique=True) agree_fundraising = models.BooleanField(_('agree fundraising'), default=False) diff --git a/src/search/forms.py b/src/search/forms.py index 34af136dc..4fa051d7a 100644 --- a/src/search/forms.py +++ b/src/search/forms.py @@ -2,7 +2,7 @@ # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # from django import forms -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from search.fields import JQueryAutoCompleteSearchField diff --git a/src/social/admin.py b/src/social/admin.py index 91ebcdba0..22cc3e303 100644 --- a/src/social/admin.py +++ b/src/social/admin.py @@ -4,7 +4,7 @@ from django.contrib import admin from django.forms import ModelForm from django.forms.widgets import TextInput -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from admin_ordering.admin import OrderableAdmin from social.models import Cite, BannerGroup, Carousel, CarouselItem diff --git a/src/social/forms.py b/src/social/forms.py index 5c0973c19..1e2462ac0 100644 --- a/src/social/forms.py +++ b/src/social/forms.py @@ -2,7 +2,7 @@ # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # from django import forms -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from catalogue.models import Tag from catalogue import utils diff --git a/src/social/models.py b/src/social/models.py index 4c8cd7430..b254b22dc 100644 --- a/src/social/models.py +++ b/src/social/models.py @@ -6,7 +6,7 @@ from django.db import models from django.conf import settings from django.core.exceptions import ValidationError from django.urls import reverse -from django.utils.translation import ugettext_lazy as _, get_language +from django.utils.translation import gettext_lazy as _, get_language from catalogue.models import Book from wolnelektury.utils import cached_render, clear_cached_renders diff --git a/src/sponsors/models.py b/src/sponsors/models.py index 905631394..704b06630 100644 --- a/src/sponsors/models.py +++ b/src/sponsors/models.py @@ -6,7 +6,7 @@ import time from io import BytesIO from django.core.cache import cache from django.db import models -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from django.template.loader import render_to_string from PIL import Image diff --git a/src/suggest/forms.py b/src/suggest/forms.py index b276f0396..1fdfc6089 100644 --- a/src/suggest/forms.py +++ b/src/suggest/forms.py @@ -7,8 +7,8 @@ from django.core.exceptions import ValidationError from django.core.mail import send_mail, mail_managers from django.core.validators import validate_email from django.urls import reverse -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 newsletter.forms import NewsletterForm from suggest.models import PublishingSuggestion, Suggestion @@ -55,8 +55,8 @@ Kontakt: %(contact)s pass else: send_noreply_mail( - ugettext('Thank you for your suggestion.'), - ugettext("""\ + gettext('Thank you for your suggestion.'), + gettext("""\ Thank you for your comment on WolneLektury.pl. The suggestion has been referred to the project coordinator."""), [contact], fail_silently=True) @@ -73,7 +73,7 @@ class PublishingSuggestForm(NewsletterForm): def clean(self): if not self.cleaned_data['ebook'] and not self.cleaned_data['audiobook']: - msg = ugettext("One of these options is required.") + msg = gettext("One of these options is required.") self._errors['ebook'] = self.error_class([msg]) self._errors['audiobook'] = self.error_class([msg]) return super(PublishingSuggestForm, self).clean() @@ -119,8 +119,8 @@ class PublishingSuggestForm(NewsletterForm): pass else: send_noreply_mail( - ugettext('Thank you for your suggestion.'), - ugettext("""\ + gettext('Thank you for your suggestion.'), + gettext("""\ Thank you for your comment on WolneLektury.pl. The suggestion has been referred to the project coordinator."""), [contact], fail_silently=True) diff --git a/src/suggest/models.py b/src/suggest/models.py index a5742d897..1e5f2b062 100644 --- a/src/suggest/models.py +++ b/src/suggest/models.py @@ -6,7 +6,7 @@ from datetime import timedelta from django.db import models from django.contrib.auth.models import User -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ class Suggestion(models.Model): diff --git a/src/suggest/views.py b/src/suggest/views.py index 060ac591e..96e121e39 100644 --- a/src/suggest/views.py +++ b/src/suggest/views.py @@ -2,7 +2,7 @@ # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # from django.urls import reverse_lazy -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from ajaxable.utils import AjaxableFormView from suggest import forms diff --git a/src/wolnelektury/settings/basic.py b/src/wolnelektury/settings/basic.py index c640d3144..133db91e2 100644 --- a/src/wolnelektury/settings/basic.py +++ b/src/wolnelektury/settings/basic.py @@ -25,6 +25,8 @@ DATABASES = { } } +DEFAULT_AUTO_FIELD = 'django.db.models.AutoField' + SOLR_TEST = "http://localhost:8983/solr/wl_test/" SOLR_STOPWORDS = "/path/to/solr/data/conf/lang/stopwords_pl.txt" diff --git a/src/wolnelektury/views.py b/src/wolnelektury/views.py index 5e56f5906..61c55c40e 100644 --- a/src/wolnelektury/views.py +++ b/src/wolnelektury/views.py @@ -13,7 +13,7 @@ from django.core.cache import cache from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import render from django.utils.http import urlquote_plus -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from django.views.decorators.cache import never_cache from ajaxable.utils import AjaxableFormView -- 2.20.1