fixed bug in admin form due to django upgrade
This commit is contained in:
parent
7dc04063d8
commit
78bc4a1e04
1 changed files with 5 additions and 2 deletions
|
|
@ -147,6 +147,7 @@ class CLabPinForm(forms.Form):
|
||||||
|
|
||||||
|
|
||||||
class AdminForm(forms.Form):
|
class AdminForm(forms.Form):
|
||||||
|
username = forms.ChoiceField(choices=[])
|
||||||
password1 = forms.CharField(max_length=255, widget=forms.PasswordInput,
|
password1 = forms.CharField(max_length=255, widget=forms.PasswordInput,
|
||||||
label=_('New password'))
|
label=_('New password'))
|
||||||
password2 = forms.CharField(max_length=255, widget=forms.PasswordInput,
|
password2 = forms.CharField(max_length=255, widget=forms.PasswordInput,
|
||||||
|
|
@ -159,8 +160,10 @@ class AdminForm(forms.Form):
|
||||||
choices = [x for x in self._users]
|
choices = [x for x in self._users]
|
||||||
choices.insert(0, ('', 'Select username ...'))
|
choices.insert(0, ('', 'Select username ...'))
|
||||||
super(AdminForm, self).__init__(*args, **kwargs)
|
super(AdminForm, self).__init__(*args, **kwargs)
|
||||||
self.fields.insert(0, 'username', forms.ChoiceField(choices=choices,
|
#self.fields.insert(0, 'username', forms.ChoiceField(choices=choices,
|
||||||
help_text=_('Select the username for whom you want to reset the password.')))
|
#help_text=_('Select the username for whom you want to reset the password.')))
|
||||||
|
self.fields['username'] = forms.ChoiceField(choices=choices,
|
||||||
|
help_text=_('Select the username for whom you want to reset the password.'))
|
||||||
|
|
||||||
def clean(self):
|
def clean(self):
|
||||||
cleaned_data = super(AdminForm, self).clean()
|
cleaned_data = super(AdminForm, self).clean()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue