提交 fe030111 编写于 作者: baltery's avatar baltery

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

上级 9ffb079c
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册