Commit c508d87b authored by Hypsug0's avatar Hypsug0
Browse files

Black/iSort format

parent 37555d91
......@@ -81,11 +81,7 @@ class UserCreateAdminForm(UserCreationForm):
self.helper.layout = Layout(
Row(
Column(
Submit(
"submit",
_("Enregistrer"),
css_class="btn-primary btn-sm",
),
Submit("submit", _("Enregistrer"), css_class="btn-primary btn-sm",),
Button(
"cancel",
_("Annuler"),
......@@ -105,17 +101,12 @@ class UserCreateAdminForm(UserCreationForm):
_("Identité"),
Row(
Column("email", css_class="col-xs-12 col-lg-6"),
Column("organism", css_class="col-xs-12 col-lg-6",),
Column(
"organism",
css_class="col-xs-12 col-lg-6",
),
Column(
"first_name",
css_class="col-xs-12 col-lg-6",
"first_name", css_class="col-xs-12 col-lg-6",
),
Column(
"last_name",
css_class="col-xs-12 col-lg-6",
"last_name", css_class="col-xs-12 col-lg-6",
),
),
Row(
......@@ -144,8 +135,7 @@ class UserCreateAdminForm(UserCreationForm):
css_class="col-xs-12 col-lg-6",
),
Column(
"edit_all_data",
css_class="col-xs-12 col-lg-6",
"edit_all_data", css_class="col-xs-12 col-lg-6",
),
Column("catchauth", css_class="col-lg-12"),
),
......@@ -167,8 +157,7 @@ class UserCreateAdminForm(UserCreationForm):
Fieldset(
_("Adresse postale"),
Column(
"addr_appt",
css_class="col-lg-2 col-md-3 col-xs-6",
"addr_appt", css_class="col-lg-2 col-md-3 col-xs-6",
),
Column(
"addr_building",
......@@ -180,8 +169,7 @@ class UserCreateAdminForm(UserCreationForm):
),
Column("addr_city", css_class="col-lg-6 col-md-12"),
Column(
"addr_city_code",
css_class="col-lg-3 col-md-12",
"addr_city_code", css_class="col-lg-3 col-md-12",
),
Column("addr_dept", css_class="col-lg-3 col-md-12"),
Column("addr_country", css_class="col-lg-12"),
......@@ -194,9 +182,7 @@ class UserCreateAdminForm(UserCreationForm):
"Source",
Row(
Column(
"bdsource",
css_class="col-md-6 col-xs-12",
readonly=True,
"bdsource", css_class="col-md-6 col-xs-12", readonly=True,
),
Column(
"id_bdsource",
......@@ -211,11 +197,7 @@ class UserCreateAdminForm(UserCreationForm):
),
Row(
Column(
Submit(
"submit",
_("Enregistrer"),
css_class="btn-primary btn-sm",
),
Submit("submit", _("Enregistrer"), css_class="btn-primary btn-sm",),
Button(
"cancel",
_("Annuler"),
......@@ -281,11 +263,7 @@ class UserCreateForm(UserCreationForm):
self.helper.layout = Layout(
Row(
Column(
Submit(
"submit",
_("Enregistrer"),
css_class="btn-primary btn-sm",
),
Submit("submit", _("Enregistrer"), css_class="btn-primary btn-sm",),
Button(
"cancel",
_("Annuler"),
......@@ -305,17 +283,12 @@ class UserCreateForm(UserCreationForm):
_("Identité"),
Row(
Column("email", css_class="col-xs-12 col-lg-6"),
Column("organism", css_class="col-xs-12 col-lg-6",),
Column(
"organism",
css_class="col-xs-12 col-lg-6",
"first_name", css_class="col-xs-12 col-lg-6",
),
Column(
"first_name",
css_class="col-xs-12 col-lg-6",
),
Column(
"last_name",
css_class="col-xs-12 col-lg-6",
"last_name", css_class="col-xs-12 col-lg-6",
),
),
Row(
......@@ -347,8 +320,7 @@ class UserCreateForm(UserCreationForm):
Fieldset(
_("Adresse postale"),
Column(
"addr_appt",
css_class="col-lg-2 col-md-3 col-xs-6",
"addr_appt", css_class="col-lg-2 col-md-3 col-xs-6",
),
Column(
"addr_building",
......@@ -360,8 +332,7 @@ class UserCreateForm(UserCreationForm):
),
Column("addr_city", css_class="col-lg-6 col-md-12"),
Column(
"addr_city_code",
css_class="col-lg-3 col-md-12",
"addr_city_code", css_class="col-lg-3 col-md-12",
),
Column("addr_dept", css_class="col-lg-3 col-md-12"),
Column("addr_country", css_class="col-lg-12"),
......@@ -374,9 +345,7 @@ class UserCreateForm(UserCreationForm):
"Source",
Row(
Column(
"bdsource",
css_class="col-md-6 col-xs-12",
readonly=True,
"bdsource", css_class="col-md-6 col-xs-12", readonly=True,
),
Column(
"id_bdsource",
......@@ -391,11 +360,7 @@ class UserCreateForm(UserCreationForm):
),
Row(
Column(
Submit(
"submit",
_("Enregistrer"),
css_class="btn-primary btn-sm",
),
Submit("submit", _("Enregistrer"), css_class="btn-primary btn-sm",),
Button(
"cancel",
_("Annuler"),
......@@ -534,11 +499,7 @@ class UserUpdateAdminForm(forms.ModelForm):
self.helper.layout = Layout(
Row(
Column(
Submit(
"submit",
_("Enregistrer"),
css_class="btn-primary btn-sm",
),
Submit("submit", _("Enregistrer"), css_class="btn-primary btn-sm",),
Button(
"cancel",
_("Annuler"),
......@@ -575,20 +536,17 @@ class UserUpdateAdminForm(forms.ModelForm):
Fieldset(
_("Responsabilité et autorisations"),
Column(
"is_resp",
css_class="col-xs-12 col-md-3 col-lg-2",
"is_resp", css_class="col-xs-12 col-md-3 col-lg-2",
),
Column(
"resp_territory",
css_class="col-xs-12 col-md-9 col-lg-10",
),
Column(
"access_all_data",
css_class="col-xs-12 col-lg-6",
"access_all_data", css_class="col-xs-12 col-lg-6",
),
Column(
"edit_all_data",
css_class="col-xs-12 col-lg-6",
"edit_all_data", css_class="col-xs-12 col-lg-6",
),
Column("catchauth", css_class="col-lg-12"),
css_class="col-lg-12",
......@@ -609,8 +567,7 @@ class UserUpdateAdminForm(forms.ModelForm):
Fieldset(
_("Adresse postale"),
Column(
"addr_appt",
css_class="col-lg-2 col-md-3 col-xs-6",
"addr_appt", css_class="col-lg-2 col-md-3 col-xs-6",
),
Column(
"addr_building",
......@@ -622,8 +579,7 @@ class UserUpdateAdminForm(forms.ModelForm):
),
Column("addr_city", css_class="col-lg-6 col-md-12"),
Column(
"addr_city_code",
css_class="col-lg-3 col-md-12",
"addr_city_code", css_class="col-lg-3 col-md-12",
),
Column("addr_dept", css_class="col-lg-3 col-md-12"),
Column("addr_country", css_class="col-lg-12"),
......@@ -636,9 +592,7 @@ class UserUpdateAdminForm(forms.ModelForm):
"Source",
Row(
Column(
"bdsource",
css_class="col-md-6 col-xs-12",
readonly=True,
"bdsource", css_class="col-md-6 col-xs-12", readonly=True,
),
Column(
"id_bdsource",
......@@ -653,11 +607,7 @@ class UserUpdateAdminForm(forms.ModelForm):
),
Row(
Column(
Submit(
"submit",
_("Enregistrer"),
css_class="btn-primary btn-sm",
),
Submit("submit", _("Enregistrer"), css_class="btn-primary btn-sm",),
Button(
"cancel",
_("Annuler"),
......@@ -689,9 +639,7 @@ class UserAdminUpdatePasswordForm(forms.ModelForm):
help_text=password_validation.password_validators_help_text_html(),
)
new_password2 = forms.CharField(
label=_("New password confirmation"),
strip=False,
widget=forms.PasswordInput,
label=_("New password confirmation"), strip=False, widget=forms.PasswordInput,
)
class Meta:
......@@ -734,8 +682,7 @@ class UserAdminUpdatePasswordForm(forms.ModelForm):
if password1 and password2:
if password1 != password2:
raise forms.ValidationError(
self.error_messages["password_mismatch"],
code="password_mismatch",
self.error_messages["password_mismatch"], code="password_mismatch",
)
password_validation.validate_password(password2)
return password2
......@@ -790,17 +737,12 @@ class UserUpdateForm(forms.ModelForm):
Fieldset(
_("Caractéristiques principales"),
Row(
Column("email", css_class="col-xs-12 col-md-12 col-lg-4",),
Column(
"email",
css_class="col-xs-12 col-md-12 col-lg-4",
"first_name", css_class="col-xs-12 col-md-6 col-lg-4",
),
Column(
"first_name",
css_class="col-xs-12 col-md-6 col-lg-4",
),
Column(
"last_name",
css_class="col-xs-12 col-md-6 col-lg-4",
"last_name", css_class="col-xs-12 col-md-6 col-lg-4",
),
Field("username", type="hidden"),
),
......@@ -808,18 +750,12 @@ class UserUpdateForm(forms.ModelForm):
Fieldset(
_("Responsabilité et autorisations"),
Row(
Column(
"is_resp",
css_class="col-xs-12 col-md-3 col-lg-2",
),
Column("is_resp", css_class="col-xs-12 col-md-3 col-lg-2",),
Column(
"resp_territory",
css_class="col-xs-12 col-md-9 col-lg-10",
),
Column(
"access_all_data",
css_class="col-xs-12 col-lg-6",
),
Column("access_all_data", css_class="col-xs-12 col-lg-6",),
Column("edit_all_data", css_class="col-xs-12 col-lg-6"),
Column("catchauth", css_class="col-lg-12"),
),
......@@ -836,13 +772,9 @@ class UserUpdateForm(forms.ModelForm):
_("Adresse postale"),
Column("addr_appt", css_class="col-lg-2 col-md-3 col-xs-6"),
Column(
"addr_building",
css_class="col-lg-2 col-md-3 col-xs-6",
),
Column(
"addr_street",
css_class="col-lg-8 col-md-6 col-xs-12",
"addr_building", css_class="col-lg-2 col-md-3 col-xs-6",
),
Column("addr_street", css_class="col-lg-8 col-md-6 col-xs-12",),
Column("addr_city", css_class="col-lg-6 col-md-12"),
Column("addr_city_code", css_class="col-lg-3 col-md-12"),
Column("addr_dept", css_class="col-lg-3 col-md-12"),
......@@ -906,11 +838,7 @@ class PasswordResetForm(PasswordResetForm):
self.helper.layout = Layout(
"email",
Div(
Submit(
"submit",
"Réinitialiser le mot de passe",
css_class="button",
),
Submit("submit", "Réinitialiser le mot de passe", css_class="button",),
HTML('<a class="button alert" href="/">Annuler</a>'),
css_class="text-right",
),
......
......@@ -4,7 +4,6 @@ from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.auth.models import (
AbstractBaseUser,
AbstractUser,
PermissionsMixin,
UserManager,
)
......@@ -82,9 +81,7 @@ class Profile(AbstractBaseUser, PermissionsMixin):
default=False, verbose_name=_("Peut éditer toutes les données")
)
catchauth = models.ManyToManyField(
"management.CatchAuth",
blank=True,
verbose_name=_("Authorisations de capture"),
"management.CatchAuth", blank=True, verbose_name=_("Authorisations de capture"),
)
organism = models.CharField(
max_length=255, blank=True, null=True, verbose_name=_("Organisme")
......
......@@ -83,7 +83,7 @@ PROJECT_APPS = [
"core",
"accounts",
"geodata",
"metadata",
# "metadata",
"management",
"dicts",
"sights",
......
......@@ -38,11 +38,7 @@ LOGGING = {
},
},
"loggers": {
"": {
"handlers": ["file", "console"],
"level": "WARNING",
"propagate": True,
},
"": {"handlers": ["file", "console"], "level": "WARNING", "propagate": True,},
"django.requests": {
"handlers": ["file", "console"],
"level": "DEBUG",
......@@ -53,21 +49,9 @@ LOGGING = {
"level": "DEBUG",
"propagate": True,
},
"api": {
"handlers": ["file", "console"],
"level": "DEBUG",
"propagate": True,
},
"blog": {
"handlers": ["file", "console"],
"level": "DEBUG",
"propagate": True,
},
"core": {
"handlers": ["file", "console"],
"level": "DEBUG",
"propagate": True,
},
"api": {"handlers": ["file", "console"], "level": "DEBUG", "propagate": True,},
"blog": {"handlers": ["file", "console"], "level": "DEBUG", "propagate": True,},
"core": {"handlers": ["file", "console"], "level": "DEBUG", "propagate": True,},
"dbchiro": {
"handlers": ["file", "console"],
"level": "DEBUG",
......
......@@ -16,10 +16,6 @@ territory_shp = os.path.abspath(
def run(verbose=True):
lm = LayerMapping(
Territory,
territory_shp,
territory_mapping,
transform=False,
encoding="utf-8",
Territory, territory_shp, territory_mapping, transform=False, encoding="utf-8",
)
lm.save(strict=True, verbose=verbose)
......@@ -59,9 +59,7 @@ class LandCover(models.Model):
on_delete=models.CASCADE,
)
geom = models.MultiPolygonField(
srid=settings.GEODATA_SRID,
verbose_name=_("Géométries"),
spatial_index=True,
srid=settings.GEODATA_SRID, verbose_name=_("Géométries"), spatial_index=True,
)
def __str__(self):
......
......@@ -42,11 +42,7 @@ class StudyForm(forms.ModelForm):
self.helper.layout = Layout(
Row(
Column(
Submit(
"submit",
_("Enregistrer"),
css_class="btn-primary btn-sm",
),
Submit("submit", _("Enregistrer"), css_class="btn-primary btn-sm",),
Button(
"cancel",
_("Annuler"),
......@@ -67,34 +63,22 @@ class StudyForm(forms.ModelForm):
Column("name", css_class="col-lg-4 col-xs-12"),
Column("year", css_class="col-lg-4 col-xs-6"),
Column(
"project_manager",
css_class="col-lg-4 col-xs-6",
"project_manager", css_class="col-lg-4 col-xs-6",
),
Column("type_etude", css_class="col-lg-6 col-xs-12"),
Column(
"type_espace",
css_class="col-lg-6 col-xs-12",
),
Column("type_espace", css_class="col-lg-6 col-xs-12",),
css_class="col-lg-12",
),
Fieldset(
_("Caractéristiques principales"),
Column(
"public_funding",
css_class="col-lg-4 col-xs-6",
),
Column(
"public_report",
css_class="col-lg-4 col-xs-6",
),
Column(
"public_raw_data",
css_class="col-lg-4 col-xs-6",
"public_funding", css_class="col-lg-4 col-xs-6",
),
Column("public_report", css_class="col-lg-4 col-xs-6",),
Column(
"confidential",
css_class="col-lg-6 col-xs-6",
"public_raw_data", css_class="col-lg-4 col-xs-6",
),
Column("confidential", css_class="col-lg-6 col-xs-6",),
Column(
"confidential_end_date",
css_class="col-lg-6 col-xs-6",
......@@ -110,11 +94,7 @@ class StudyForm(forms.ModelForm):
),
Row(
Column(
Submit(
"submit",
_("Enregistrer"),
css_class="btn-primary btn-sm",
),
Submit("submit", _("Enregistrer"), css_class="btn-primary btn-sm",),
Button(
"cancel",
_("Annuler"),
......@@ -155,11 +135,7 @@ class TransmitterForm(forms.ModelForm):
self.helper.layout = Layout(
Row(
Column(
Submit(
"submit",
_("Enregistrer"),
css_class="btn-primary btn-sm",
),
Submit("submit", _("Enregistrer"), css_class="btn-primary btn-sm",),
Button(
"cancel",
_("Annuler"),
......@@ -184,13 +160,9 @@ class TransmitterForm(forms.ModelForm):
Column("autonomy", css_class="col-lg-4 col-md-6 col-xs-12"),
Column("model", css_class="col-lg-4 col-md-6 col-xs-12"),
Column("brand", css_class="col-lg-4 col-md-6 col-xs-12"),
Column("buying_date", css_class="col-lg-6 col-md-6 col-xs-12",),
Column(
"buying_date",
css_class="col-lg-6 col-md-6 col-xs-12",
),
Column(
"last_recond_date",
css_class="col-lg-6 col-md-6 col-xs-12",
"last_recond_date", css_class="col-lg-6 col-md-6 col-xs-12",
),
),
Row(
......@@ -204,11 +176,7 @@ class TransmitterForm(forms.ModelForm):
),
Row(
Column(
Submit(
"submit",
_("Enregistrer"),
css_class="btn-primary btn-sm",
),
Submit("submit", _("Enregistrer"), css_class="btn-primary btn-sm",),
Button(
"cancel",
_("Annuler"),
......@@ -251,11 +219,7 @@ class CatchAuthForm(forms.ModelForm):
self.helper.layout = Layout(
Row(
Column(
Submit(
"submit",
_("Enregistrer"),
css_class="btn-primary btn-sm",
),
Submit("submit", _("Enregistrer"), css_class="btn-primary btn-sm",),
Button(
"cancel",
_("Annuler"),
......@@ -282,11 +246,7 @@ class CatchAuthForm(forms.ModelForm):
),
Row(
Column(
Submit(
"submit",
_("Enregistrer"),
css_class="btn-primary btn-sm",
),
Submit("submit", _("Enregistrer"), css_class="btn-primary btn-sm",),
Button(
"cancel",
_("Annuler"),
......
......@@ -17,17 +17,13 @@ class CatchAuth(models.Model):
related_name="catchauth",
)
date_start = models.DateField(
verbose_name=_("Date de début d'application"),
help_text=_("format jj/mm/aaaa"),
verbose_name=_("Date de début d'application"), help_text=_("format jj/mm/aaaa"),
)
date_end = models.DateField(
verbose_name=_("Date de fin d'application"),
help_text=_("format jj/mm/aaaa"),
verbose_name=_("Date de fin d'application"), help_text=_("format jj/mm/aaaa"),
)
official_reference = models.CharField(
max_length=255,
unique=True,
verbose_name=_("Référence du texte officiel"),
max_length=255, unique=True, verbose_name=_("Référence du texte officiel"),
)
file = models.FileField(
upload_to="catchauth/%Y/",
......@@ -78,9 +74,7 @@ class Study(models.Model):
max_length=255, db_index=True, verbose_name="nom du l'étude"
)
year = models.CharField(
max_length=10,
db_index=True,
verbose_name="Année de réalisation l'étude",
max_length=10, db_index=True, verbose_name="Année de réalisation l'étude",
)
project_manager = models.ForeignKey(
settings.AUTH_USER_MODEL,
......@@ -177,10 +171,7 @@ class Transmitter(models.Model):
null=True, blank=True, verbose_name="Date de dernier reconditionnement"
)
status = models.CharField(
max_length=50,
choices=TRANSMITTER_STATUS,
default="ok",
verbose_name="Statut",
max_length=50, choices=TRANSMITTER_STATUS, default="ok", verbose_name="Statut",
)
available = models.BooleanField(
verbose_name="Disponible pour la saisie", default=True
......
def log_check(object):
return (
f"\nname\t{type(object).__name__}\nvalue\t{object}\n"
f"type\t{type(object)}\ndir\t{dir(object)}"
)
......@@ -79,10 +79,7 @@ class CountDetailInLine(nested_admin.NestedStackedInline):
(
"Données biométriques",
{
"classes": (
"collapse",
"grp-collapse grp-open",
),
"classes": ("collapse", "grp-collapse grp-open",),
"fields": (
("ab", "d5", "d3", "pouce"),
("queue", "tibia", "cm3", "tragus"),
......@@ -165,10 +162,7 @@ class SessionInLine(nested_admin.NestedStackedInline):
(
"Commentaire",
{
"classes": (
"collapse",
"grp-collapse grp-open",
),
"classes": ("collapse", "grp-collapse grp-open",),
"fields": ("comment",),
},
),
......@@ -198,10 +192,7 @@ class SessionAdmin(nested_admin.NestedModelAdmin):
(
"Commentaire",
{
"classes": (
"collapse",
"grp-collapse grp-open",