mirror of https://github.com/jumpserver/jumpserver
[Update] 不允许添加应用程序类型的用户
parent
9ffb079c8f
commit
fe03011177
|
@ -20,10 +20,12 @@ class UserLoginForm(AuthenticationForm):
|
||||||
|
|
||||||
|
|
||||||
class UserCreateUpdateForm(forms.ModelForm):
|
class UserCreateUpdateForm(forms.ModelForm):
|
||||||
|
role_choices = ((i, n) for i, n in User.ROLE_CHOICES if i != User.ROLE_APP)
|
||||||
password = forms.CharField(
|
password = forms.CharField(
|
||||||
label=_('Password'), widget=forms.PasswordInput,
|
label=_('Password'), widget=forms.PasswordInput,
|
||||||
max_length=128, strip=False, required=False,
|
max_length=128, strip=False, required=False,
|
||||||
)
|
)
|
||||||
|
role = forms.ChoiceField(choices=role_choices, required=True, initial=User.ROLE_USER, label=_("Role"))
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = User
|
model = User
|
||||||
|
|
Loading…
Reference in New Issue