Commit fdb1e48e authored by Vincent Le gallic's avatar Vincent Le gallic

[settings, forms] On impose l'ordre des masques de droits

Suite à 23e88240, l'ordre était random
parent 23e88240
......@@ -12,7 +12,7 @@ class LoginForm(forms.Form):
"""Formulaire de login"""
username = forms.CharField(label="Pseudo")
password = forms.CharField(label="Mot de passe", widget=forms.PasswordInput(render_value=False))
droits = forms.ChoiceField(choices=[(k, v[0]) for (k, v) in settings.ACL_MASKS.items()])
droits = forms.ChoiceField(choices=[(k, settings.ACL_MASKS[k][0]) for k in settings._acl_masks_keys])
class InviteForm(forms.Form):
"""Formulaire d'invitation"""
......
......@@ -298,7 +298,10 @@ SUCCMSG_DEVALIDATE_TRANSACTION = u"Transaction dévalidée avec succès."
_acl_restricted = ["wei", "overforced", "transactions_admin", "chgpass", "comptes", "boutons", "admin"]
#: Dico recensant les masques de droits : ``keyword`` -> ``("nom à afficher", <masque>)``
#: ils seront proposés dans l'ordre des keywords
ACL_MASKS = {
'all': (u"Tous mes droits", [[], [], False]),
'restricted': (u"Moins de droits", [_acl_restricted, _acl_restricted, True]),
'0_all': (u"Tous mes droits", [[], [], False]),
'1_restricted': (u"Moins de droits", [_acl_restricted, _acl_restricted, True]),
}
_acl_masks_keys = ACL_MASKS.keys()
_acl_masks_keys.sort()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment