mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-06-25 19:47:23 +02:00
Merge branch 'migration-django-4-2' into 'main'
[Draft] nk20 v2.0.0 with django 4.2 See merge request bde/nk20!230
This commit is contained in:
@ -3,7 +3,7 @@
|
||||
|
||||
import io
|
||||
|
||||
from PIL import Image, ImageSequence
|
||||
from bootstrap_datepicker_plus.widgets import DatePickerInput
|
||||
from django import forms
|
||||
from django.conf import settings
|
||||
from django.contrib.auth.forms import AuthenticationForm
|
||||
@ -13,8 +13,9 @@ from django.forms import CheckboxSelectMultiple
|
||||
from django.utils import timezone
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from note.models import NoteSpecial, Alias
|
||||
from note_kfet.inputs import Autocomplete, AmountInput, DatePickerInput
|
||||
from note_kfet.inputs import Autocomplete, AmountInput
|
||||
from permission.models import PermissionMask, Role
|
||||
from PIL import Image, ImageSequence
|
||||
|
||||
from .models import Profile, Club, Membership
|
||||
|
||||
@ -32,7 +33,7 @@ class UserForm(forms.ModelForm):
|
||||
# Django usernames can only contain letters, numbers, @, ., +, - and _.
|
||||
# We want to allow users to have uncommon and unpractical usernames:
|
||||
# That is their problem, and we have normalized aliases for us.
|
||||
return super()._get_validation_exclusions() + ["username"]
|
||||
return super()._get_validation_exclusions() | {"username"}
|
||||
|
||||
class Meta:
|
||||
model = User
|
||||
@ -121,7 +122,7 @@ class ImageForm(forms.Form):
|
||||
frame = frame.crop((x, y, x + w, y + h))
|
||||
frame = frame.resize(
|
||||
(settings.PIC_WIDTH, settings.PIC_RATIO * settings.PIC_WIDTH),
|
||||
Image.ANTIALIAS,
|
||||
Image.LANCZOS,
|
||||
)
|
||||
frames.append(frame)
|
||||
|
||||
|
Reference in New Issue
Block a user