mirror of
https://github.com/retspen/webvirtcloud
synced 2025-01-12 08:25:18 +00:00
fix create user error
This commit is contained in:
parent
7dd9127572
commit
372ba5a0f2
1 changed files with 8 additions and 7 deletions
|
@ -73,13 +73,14 @@ class UserForm(forms.ModelForm):
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super(UserForm, self).__init__(*args, **kwargs)
|
super(UserForm, self).__init__(*args, **kwargs)
|
||||||
password = ReadOnlyPasswordHashField(label=_("Password"),
|
if self.instance.id:
|
||||||
help_text=format_lazy(_("""Raw passwords are not stored, so there is no way to see
|
password = ReadOnlyPasswordHashField(label=_("Password"),
|
||||||
this user's password, but you can change the password
|
help_text=format_lazy(_("""Raw passwords are not stored, so there is no way to see
|
||||||
using <a href='{}'>this form</a>."""),
|
this user's password, but you can change the password
|
||||||
reverse_lazy('admin:user_update_password', args=[self.instance.id,]))
|
using <a href='{}'>this form</a>."""),
|
||||||
)
|
reverse_lazy('admin:user_update_password', args=[self.instance.id,]))
|
||||||
self.fields['Password'] = password
|
)
|
||||||
|
self.fields['Password'] = password
|
||||||
|
|
||||||
|
|
||||||
class UserCreateForm(UserForm):
|
class UserCreateForm(UserForm):
|
||||||
|
|
Loading…
Reference in a new issue