From c77b79e3ec73c7e064da15c18dac9cf7c53acb01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20P=C3=A9pin?= Date: Sat, 5 Sep 2020 22:57:08 +0200 Subject: [PATCH] =?UTF-8?q?make=20black=20happy=E2=80=A6=20again?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- authens/forms.py | 3 +-- authens/models.py | 8 ++++++-- example_site/example_site/settings.py | 12 +++++++++--- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/authens/forms.py b/authens/forms.py index 55ab14c..08fcc22 100644 --- a/authens/forms.py +++ b/authens/forms.py @@ -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 diff --git a/authens/models.py b/authens/models.py index eba5769..a1cbd25 100644 --- a/authens/models.py +++ b/authens/models.py @@ -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") diff --git a/example_site/example_site/settings.py b/example_site/example_site/settings.py index 8ec4365..290af94 100644 --- a/example_site/example_site/settings.py +++ b/example_site/example_site/settings.py @@ -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", + }, ]