forked from DGNum/gestioCOF
Fix perm account_update
This commit is contained in:
parent
b390220b27
commit
a78ad8c4ef
1 changed files with 2 additions and 3 deletions
|
@ -294,7 +294,7 @@ def account_update(request, trigramme):
|
|||
if request.method == "POST":
|
||||
# Update attempt
|
||||
success = False
|
||||
missing_perm = False
|
||||
missing_perm = True
|
||||
|
||||
if request.user.has_perm('kfet.is_team'):
|
||||
account_form = AccountForm(request.POST, instance=account)
|
||||
|
@ -308,6 +308,7 @@ def account_update(request, trigramme):
|
|||
if (request.user.has_perm('kfet.change_account')
|
||||
and account_form.is_valid() and cof_form.is_valid()
|
||||
and user_form.is_valid()):
|
||||
missing_perm = False
|
||||
data = {}
|
||||
# Fill data for Account.save()
|
||||
put_cleaned_data_in_dict(data, user_form)
|
||||
|
@ -351,8 +352,6 @@ def account_update(request, trigramme):
|
|||
success = True
|
||||
messages.success(request,
|
||||
'Informations du compte %s mises à jour' % account.trigramme)
|
||||
elif not request.user.has_perm('kfet.change_account'):
|
||||
missing_perm = True
|
||||
|
||||
if request.user == account.user:
|
||||
missing_perm = False
|
||||
|
|
Loading…
Reference in a new issue