diff --git a/app/forms/account.py b/app/forms/account.py index 660a7e3..936c760 100644 --- a/app/forms/account.py +++ b/app/forms/account.py @@ -189,8 +189,8 @@ class AdminUpdateAccountForm(FlaskForm): vd.email, ], ) - email_validate = BooleanField( - "Envoyer un email de validation à la nouvelle adresse", + email_confirmed = BooleanField( + "Confirmer l'email", description="Si décoché, l'utilisateur devra demander explicitement un email "\ "de validation, ou faire valider son adresse email par un administrateur.", ) diff --git a/app/models/users.py b/app/models/users.py index 1fc14ad..36ea44a 100644 --- a/app/models/users.py +++ b/app/models/users.py @@ -160,14 +160,15 @@ class Member(User): """ Update all or part of the user's metadata. The [data] dictionary accepts the following keys: - "email" str User mail ddress - "password" str Raw password - "bio" str Biograpy - "signature" str Post signature - "birthday" date Birthday date - "newsletter" bool Newsletter setting - "xp" int Experience points - "avatar" File Avatar image + "email" str User mail address + "email_confirmed" bool User mail address confirmed + "password" str Raw password + "bio" str Biograpy + "signature" str Post signature + "birthday" date Birthday date + "newsletter" bool Newsletter setting + "xp" int Experience points + "avatar" File Avatar image For future compatibility, other attributes are silently ignored. None values can be specified and are ignored. @@ -198,6 +199,8 @@ class Member(User): self.set_avatar(data["avatar"]) # For admins only + if "email_confirmed" in data: + self.email_confirmed = data["email_confirmed"] if "xp" in data: self.xp = data["xp"] diff --git a/app/routes/admin/account.py b/app/routes/admin/account.py index 1e5497a..f8ddc5a 100644 --- a/app/routes/admin/account.py +++ b/app/routes/admin/account.py @@ -48,6 +48,7 @@ def adm_edit_account(user_id): avatar=form.avatar.data or None, name=form.username.data or None, email=form.email.data or None, + email_confirmed=form.email_confirmed.data, password=form.password.data or None, birthday=form.birthday.data, signature=form.signature.data, diff --git a/app/templates/admin/edit_account.html b/app/templates/admin/edit_account.html index c4b821d..af3f4d0 100644 --- a/app/templates/admin/edit_account.html +++ b/app/templates/admin/edit_account.html @@ -37,9 +37,9 @@ {% endfor %}
- {{ form.email_validate.label }} - {{ form.email_validate(checked=True) }} -
{{ form.email_validate.description }}
+ {{ form.email_confirmed.label }} + {{ form.email_confirmed(checked=user.email_confirmed) }} +
{{ form.email_confirmed.description }}
{{ form.password.label }} diff --git a/app/templates/admin/groups_privileges.html b/app/templates/admin/groups_privileges.html index fce31ad..800ca4b 100644 --- a/app/templates/admin/groups_privileges.html +++ b/app/templates/admin/groups_privileges.html @@ -13,19 +13,19 @@ - + {% for user in users %} - + + {{ g.name }} + {{ ', ' if not loop.last }} + {% endfor %} + {{ priv }} + {{- ', ' if not loop.last }} + {% endfor %} {% endfor %}
PseudoEmailGroupesPrivilèges spéciauxModifier
Privilèges spéciauxModifier
{{ user.name }}{{ user.email }}{{ user.email }} {% for g in user.groups %} - {{ g.name }} - {{ ', ' if not loop.last }} - {% endfor %} {% for priv in user.special_privileges() %} - {{ priv }} - {{- ', ' if not loop.last }} - {% endfor %} Modifier