forked from DGNum/gestioCOF
Merge branch 'Aufinal/fix_missing_names' into 'master'
Fix le problème des prénoms manquants See merge request klub-dev-ens/gestioCOF!378
This commit is contained in:
commit
f9cde30e08
2 changed files with 2 additions and 5 deletions
|
@ -376,7 +376,7 @@ class AccountUpdateViewTests(ViewTestCaseMixin, TestCase):
|
|||
self.users["user1"].refresh_from_db()
|
||||
|
||||
self.assertInstanceExpected(
|
||||
self.accounts["user1"], {"first_name": "The first", "last_name": "The last"}
|
||||
self.accounts["user1"], {"first_name": "first", "last_name": "last"}
|
||||
)
|
||||
|
||||
def test_post_forbidden(self):
|
||||
|
|
|
@ -55,7 +55,6 @@ from kfet.forms import (
|
|||
UserForm,
|
||||
UserGroupForm,
|
||||
UserInfoForm,
|
||||
UserRestrictForm,
|
||||
)
|
||||
from kfet.models import (
|
||||
Account,
|
||||
|
@ -415,12 +414,10 @@ def account_update(request, trigramme):
|
|||
if request.user == account.user:
|
||||
missing_perm = False
|
||||
account.refresh_from_db()
|
||||
user_form = UserRestrictForm(request.POST, instance=account.user)
|
||||
account_form = AccountRestrictForm(request.POST, instance=account)
|
||||
pwd_form = AccountPwdForm(request.POST)
|
||||
|
||||
if user_form.is_valid() and account_form.is_valid():
|
||||
user_form.save()
|
||||
if account_form.is_valid():
|
||||
account_form.save()
|
||||
success = True
|
||||
messages.success(request, "Vos informations ont été mises à jour")
|
||||
|
|
Loading…
Reference in a new issue