make black happy… again

This commit is contained in:
Martin Pépin 2020-09-05 22:57:08 +02:00
parent efd386e9fc
commit c77b79e3ec
No known key found for this signature in database
GPG key ID: E7520278B1774448
3 changed files with 16 additions and 7 deletions

View file

@ -9,8 +9,7 @@ def promo_choices():
class OldCASAuthForm(forms.Form):
""" Adapts Django's AuthenticationForm to allow for OldCAS login.
"""
"""Adapts Django's AuthenticationForm to allow for OldCAS login."""
cas_login = auth_forms.UsernameField(
label=_("Ancien login clipper"), max_length=1023

View file

@ -21,7 +21,10 @@ class CASAccount(models.Model):
related_name="cas_account",
)
cas_login = models.CharField(
verbose_name=_("login CAS"), max_length=1023, blank=False, unique=True,
verbose_name=_("login CAS"),
max_length=1023,
blank=False,
unique=True,
)
entrance_year = models.SmallIntegerField(
verbose_name=_("année de création du compte CAS"), blank=False, null=False
@ -68,7 +71,8 @@ class OldCASAccount(models.Model):
# `unique_together` to be deprecated soon : we use `constraints`
constraints = [
models.UniqueConstraint(
fields=["cas_login", "entrance_year"], name="clipper_year_uniqueness",
fields=["cas_login", "entrance_year"],
name="clipper_year_uniqueness",
)
]
verbose_name = _("Ancien compte CAS")

View file

@ -88,9 +88,15 @@ AUTH_PASSWORD_VALIDATORS = [
{
"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
},
{"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",},
{"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",},
{"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",},
{
"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",
},
{
"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",
},
{
"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",
},
]