Bump to Django 4.

This commit is contained in:
Julien Palard 2023-03-18 18:30:34 +01:00
parent 016a762e83
commit 035a1a16c3
Signed by: mdk
GPG Key ID: 0EFC1AC1006886F8
15 changed files with 108 additions and 93 deletions

View File

@ -1,5 +1,5 @@
from django.contrib.auth.forms import AuthenticationForm
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
from django.forms.models import modelform_factory

View File

@ -1,7 +1,7 @@
from django.contrib.auth.models import User
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 _
class Profile(models.Model):

View File

@ -4,8 +4,8 @@ from django.contrib.auth.signals import user_logged_in, user_logged_out
#from django.contrib.sites.shortcuts import get_current_site
from django.db.models.signals import post_save
from django.dispatch import receiver
from django.utils.translation import ugettext_lazy as _
#from django.utils.translation import ugettext_noop
from django.utils.translation import gettext_lazy as _
#from django.utils.translation import gettext_noop
from ponyconf.decorators import disable_for_loaddata

View File

@ -1,6 +1,6 @@
from django.contrib.auth.decorators import login_required
from django.contrib.auth.views import LoginView
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _
from django.shortcuts import redirect, render
from django.contrib import messages

View File

@ -1,4 +1,4 @@
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _
from django.utils.html import escape
from pprint import pformat

View File

@ -3,7 +3,7 @@ from django.forms.models import modelform_factory
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import User
from django.contrib.auth.forms import UsernameField
from django.utils.translation import ugettext_lazy as _, pgettext_lazy
from django.utils.translation import gettext_lazy as _, pgettext_lazy
from django.template.defaultfilters import slugify
from django.utils.crypto import get_random_string

View File

@ -8,7 +8,7 @@ from django.db import models
from django.db.models import Q, Count, Avg, Case, When
from django.db.models.functions import Coalesce
from django.utils import timezone
from django.utils.translation import ugettext, ugettext_lazy as _
from django.utils.translation import gettext, gettext_lazy as _
from django.utils.safestring import mark_safe
from django.utils.html import escape, format_html
@ -281,7 +281,7 @@ class TalkCategory(models.Model): # type of talk (conf 30min, 1h, stand, …)
verbose_name_plural = "categories"
def __str__(self):
return ugettext(self.name)
return gettext(self.name)
def get_absolute_url(self):
return reverse('category-list')
@ -317,7 +317,7 @@ class TalkCategory(models.Model): # type of talk (conf 30min, 1h, stand, …)
class TalkManager(models.Manager):
def get_queryset(self):
qs = super().get_queryset()
qs = qs.annotate(score=Coalesce(Avg('vote__vote'), 0))
qs = qs.annotate(score=Coalesce(Avg('vote__vote'), 0.0))
return qs

View File

@ -2,7 +2,7 @@ from django.db.models.signals import pre_save, post_save
from django.dispatch import receiver
from django.contrib.sites.models import Site
from django.conf import settings
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.urls import reverse
from django.contrib.auth import get_user_model

View File

@ -2,7 +2,7 @@ from django.core.mail import send_mail
from django.shortcuts import get_object_or_404, redirect, render
from django.template.loader import render_to_string
from django.urls import reverse, reverse_lazy
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
from django.views.generic import DeleteView, FormView, TemplateView
from django.contrib import messages
from django.db.models import Q, Count, Sum

View File

@ -4,7 +4,7 @@ from django.core.mail import EmailMessage, get_connection
from django.conf import settings
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
from django.contrib.auth import get_user_model
import hashlib

View File

@ -2,7 +2,7 @@
Django settings for ponyconf project.
"""
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _
import os
@ -34,6 +34,7 @@ INSTALLED_APPS = [
'bootstrap3',
'django_select2',
'crispy_forms',
'crispy_bootstrap3',
# build-in apps
'django.contrib.admin',
@ -91,6 +92,8 @@ DATABASES = {
}
}
DEFAULT_AUTO_FIELD='django.db.models.AutoField'
# Password validation
# https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators

View File

@ -16,6 +16,6 @@ class PonyConfModel(models.Model):
def markdown_to_html(md):
html = markdown(md)
allowed_tags = bleach.ALLOWED_TAGS + ['p', 'pre', 'span' ] + ['h%d' % i for i in range(1, 7) ]
allowed_tags = bleach.ALLOWED_TAGS | {'p', 'pre', 'span' } | {'h%d' % i for i in range(1, 7)}
html = bleach.clean(html, tags=allowed_tags)
return mark_safe(html)

View File

@ -4,96 +4,104 @@
#
# pip-compile requirements-dev.in
#
asgiref==3.2.10
asgiref==3.6.0
# via django
asttokens==2.2.1
# via stack-data
backcall==0.2.0
# via ipython
bleach==3.1.5
bleach==6.0.0
# via -r requirements.in
chardet==3.0.4
chardet==5.1.0
# via -r requirements.in
decorator==4.4.2
# via
# ipython
# traitlets
django==3.1
crispy-bootstrap3==2022.1
# via -r requirements.in
decorator==5.1.1
# via ipython
django==4.1.7
# via
# -r requirements.in
# crispy-bootstrap3
# django-appconf
# django-bootstrap3
# django-colorful
# django-crispy-forms
# django-debug-toolbar
# django-extensions
# django-select2
django-appconf==1.0.4
django-appconf==1.0.5
# via django-select2
django-autoslug==1.9.8
# via -r requirements.in
django-bootstrap3==14.1.0
django-bootstrap3==22.2
# via -r requirements.in
django-colorful==1.3
# via -r requirements.in
django-crispy-forms==1.9.2
# via -r requirements.in
django-debug-toolbar==2.2
django-crispy-forms==2.0
# via
# -r requirements.in
# crispy-bootstrap3
django-debug-toolbar==3.8.1
# via -r requirements-dev.in
django-extensions==3.0.4
django-extensions==3.2.1
# via -r requirements-dev.in
django-select2==7.4.2
django-select2==8.1.1
# via -r requirements.in
icalendar==4.0.6
executing==1.2.0
# via stack-data
icalendar==5.0.4
# via -r requirements.in
ipython==7.16.1
importlib-metadata==6.0.0
# via markdown
ipython==8.11.0
# via -r requirements-dev.in
ipython-genutils==0.2.0
# via traitlets
jedi==0.17.2
jedi==0.18.2
# via ipython
jinja2==2.11.2
jinja2==3.1.2
# via -r requirements.in
markdown==3.2.2
markdown==3.4.1
# via -r requirements.in
markupsafe==1.1.1
markupsafe==2.1.2
# via jinja2
packaging==20.4
# via bleach
parso==0.7.1
matplotlib-inline==0.1.6
# via ipython
parso==0.8.3
# via jedi
pexpect==4.8.0
# via ipython
phonenumbers==8.13.4
phonenumbers==8.13.7
# via -r requirements.in
pickleshare==0.7.5
# via ipython
prompt-toolkit==3.0.5
prompt-toolkit==3.0.38
# via ipython
ptyprocess==0.6.0
ptyprocess==0.7.0
# via pexpect
pygments==2.6.1
pure-eval==0.2.2
# via stack-data
pygments==2.14.0
# via ipython
pyparsing==2.4.7
# via packaging
python-dateutil==2.8.1
python-dateutil==2.8.2
# via icalendar
pytz==2020.1
# via
# django
# icalendar
six==1.15.0
pytz==2022.7.1
# via icalendar
six==1.16.0
# via
# bleach
# packaging
# python-dateutil
# traitlets
sqlparse==0.3.1
sqlparse==0.4.3
# via
# django
# django-debug-toolbar
traitlets==4.3.3
stack-data==0.6.2
# via ipython
wcwidth==0.2.5
traitlets==5.9.0
# via
# ipython
# matplotlib-inline
wcwidth==0.2.6
# via prompt-toolkit
webencodings==0.5.1
# via bleach
# The following packages are considered to be unsafe in a requirements file:
# setuptools
zipp==3.15.0
# via importlib-metadata

View File

@ -2,6 +2,7 @@ django
django-bootstrap3
django-crispy-forms
crispy-bootstrap3
django-select2
django-colorful
django-autoslug

View File

@ -4,57 +4,60 @@
#
# pip-compile
#
asgiref==3.2.10
asgiref==3.6.0
# via django
bleach==3.1.5
bleach==6.0.0
# via -r requirements.in
chardet==3.0.4
chardet==5.1.0
# via -r requirements.in
django==3.1
crispy-bootstrap3==2022.1
# via -r requirements.in
django==4.1.7
# via
# -r requirements.in
# crispy-bootstrap3
# django-appconf
# django-bootstrap3
# django-colorful
# django-crispy-forms
# django-select2
django-appconf==1.0.4
django-appconf==1.0.5
# via django-select2
django-autoslug==1.9.8
# via -r requirements.in
django-bootstrap3==14.1.0
django-bootstrap3==22.2
# via -r requirements.in
django-colorful==1.3
# via -r requirements.in
django-crispy-forms==1.9.2
# via -r requirements.in
django-select2==7.4.2
# via -r requirements.in
icalendar==4.0.6
# via -r requirements.in
jinja2==2.11.2
# via -r requirements.in
markdown==3.2.2
# via -r requirements.in
markupsafe==1.1.1
# via jinja2
packaging==20.4
# via bleach
phonenumbers==8.13.4
# via -r requirements.in
pyparsing==2.4.7
# via packaging
python-dateutil==2.8.1
# via icalendar
pytz==2020.1
django-crispy-forms==2.0
# via
# django
# icalendar
six==1.15.0
# -r requirements.in
# crispy-bootstrap3
django-select2==8.1.1
# via -r requirements.in
icalendar==5.0.4
# via -r requirements.in
importlib-metadata==6.0.0
# via markdown
jinja2==3.1.2
# via -r requirements.in
markdown==3.4.1
# via -r requirements.in
markupsafe==2.1.2
# via jinja2
phonenumbers==8.13.7
# via -r requirements.in
python-dateutil==2.8.2
# via icalendar
pytz==2022.7.1
# via icalendar
six==1.16.0
# via
# bleach
# packaging
# python-dateutil
sqlparse==0.3.1
sqlparse==0.4.3
# via django
webencodings==0.5.1
# via bleach
zipp==3.15.0
# via importlib-metadata