Browse Source

Fix #2556 (#2563)

pull/2573/head
Vinícius Cantuária 6 years ago
committed by Edward
parent
commit
48bb0b0e37
  1. 51
      sapl/base/forms.py

51
sapl/base/forms.py

@ -64,19 +64,46 @@ def get_roles():
class UsuarioCreateForm(ModelForm): class UsuarioCreateForm(ModelForm):
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
username = forms.CharField(required=True, label="Nome de usuário", username = forms.CharField(
max_length=30) required=True,
firstname = forms.CharField(required=True, label="Nome", max_length=30) label="Nome de usuário",
lastname = forms.CharField(required=True, label="Sobrenome", max_length=30) max_length=30
password1 = forms.CharField(required=True, widget=forms.PasswordInput, )
label='Senha', max_length=128) firstname = forms.CharField(
password2 = forms.CharField(required=True, widget=forms.PasswordInput, required=True,
label='Confirmar senha', max_length=128) label="Nome",
user_active = forms.ChoiceField(required=False, choices=YES_NO_CHOICES, max_length=30
label="Usuário ativo?", initial='True') )
lastname = forms.CharField(
required=True,
label="Sobrenome",
max_length=30
)
password1 = forms.CharField(
required=True,
widget=forms.PasswordInput,
label='Senha',
min_length=6,
max_length=128
)
password2 = forms.CharField(
required=True,
widget=forms.PasswordInput,
label='Confirmar senha',
min_length=6,
max_length=128
)
user_active = forms.ChoiceField(
required=True,
choices=YES_NO_CHOICES,
label="Usuário ativo?",
initial='True'
)
roles = forms.MultipleChoiceField( roles = forms.MultipleChoiceField(
required=True, widget=forms.CheckboxSelectMultiple(), choices=get_roles) required=True,
widget=forms.CheckboxSelectMultiple(),
choices=get_roles
)
class Meta: class Meta:
model = get_user_model() model = get_user_model()

Loading…
Cancel
Save