mirror of
https://github.com/retspen/webvirtcloud
synced 2026-11-10 04:06:47 +00:00
style(accounts): the password pages have the account forms' layout
The page where a user changes their own password and the one where an administrator sets a user's password shared an old card: a horizontal form, a blue Cancel and a green Change. The administrator's had Django's "Password-based authentication: Enabled/Disabled" with a paragraph about other backends, and its password fields stayed while Disabled was chosen. Both pages now have the user and group forms' layout, each its own template. The administrator chooses how the user signs in, With a password or Without a password (such as LDAP), and the password fields and "must change it" show only with a password; Cancel goes back to the user. A user's own page says that their other sessions end, or, when they must change it, that they choose one before going on, without a Cancel. A refused password is said at its field only, without the general "Wrong Data Provided". The section styles of these forms move into webvirtcloud.css.
This commit is contained in:
parent
61979be731
commit
84dfbd5884
14 changed files with 323 additions and 193 deletions
|
|
@ -232,6 +232,8 @@ class AdminPasswordForm(AdminPasswordChangeForm):
|
|||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
self.fields["must_change_password"] = self.fields.pop("must_change_password") # last, after Django's own
|
||||
# Django's "Password-based authentication: Enabled/Disabled", said as how the user signs in
|
||||
self.fields["usable_password"].choices = [("true", _("With a password")), ("false", _("Without a password"))]
|
||||
|
||||
def clean(self):
|
||||
cleaned = super().clean()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue