From ca9889733b2581edf114217ca72db8ddea22ee04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Rodrigues?= Date: Wed, 26 Jun 2019 13:52:03 -0300 Subject: [PATCH] =?UTF-8?q?Adicionar=20edi=C3=A7=C3=A3o=20de=20nome=20de?= =?UTF-8?q?=20usu=C3=A1rio=20(#2851)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/base/forms.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/sapl/base/forms.py b/sapl/base/forms.py index d78f4a5e4..37b7d2f3b 100644 --- a/sapl/base/forms.py +++ b/sapl/base/forms.py @@ -65,11 +65,6 @@ def get_roles(): class UsuarioCreateForm(ModelForm): logger = logging.getLogger(__name__) - username = forms.CharField( - required=True, - label="Nome de usuário", - max_length=30 - ) firstname = forms.CharField( required=True, label="Nome", @@ -190,24 +185,26 @@ class UsuarioEditForm(ModelForm): class Meta: model = get_user_model() - fields = ['email', 'password1', 'password2', 'user_active', 'roles'] + fields = ['username', 'email', 'password1', 'password2', 'user_active', 'roles'] def __init__(self, *args, **kwargs): super(UsuarioEditForm, self).__init__(*args, **kwargs) - row1 = to_row([('email', 6), + row1 = to_row([('username', 12)]) + row2 = to_row([('email', 6), ('user_active', 6)]) - row2 = to_row( + row3 = to_row( [('password1', 6), ('password2', 6)]) - row3 = to_row([(form_actions(label='Salvar Alterações'), 6)]) + row4 = to_row([(form_actions(label='Salvar Alterações'), 6)]) self.helper = SaplFormHelper() self.helper.layout = Layout( row1, row2, + row3, 'roles', form_actions(label='Salvar Alterações'))