[Update] 不允许添加应用程序类型的用户

pull/1068/head
ibuler 2018-03-11 19:46:40 +08:00
parent 9ffb079c8f
commit fe03011177
1 changed files with 2 additions and 0 deletions

View File

@ -20,10 +20,12 @@ class UserLoginForm(AuthenticationForm):
class UserCreateUpdateForm(forms.ModelForm):
role_choices = ((i, n) for i, n in User.ROLE_CHOICES if i != User.ROLE_APP)
password = forms.CharField(
label=_('Password'), widget=forms.PasswordInput,
max_length=128, strip=False, required=False,
)
role = forms.ChoiceField(choices=role_choices, required=True, initial=User.ROLE_USER, label=_("Role"))
class Meta:
model = User