Browse Source

fix: editing causes new creation

master
Lucas 12 months ago
parent
commit
47e05b8dd8
  1. 4
      form_user/apps/contas/views.py

4
form_user/apps/contas/views.py

@ -22,7 +22,9 @@ class Index(Common, ListView):
class NovoEditar(Common):
def form_valid(self, form):
form_permissao = forms.PermissaoForm(self.request.POST)
form_permissao = forms.PermissaoForm(
instance=form.instance.per_custom_user.first(), data=self.request.POST
)
form_permissao.full_clean()
if not form_permissao.is_valid():

Loading…
Cancel
Save