mirror of
https://gitlab.com/brutaldon/brutaldon.git
synced 2024-12-04 14:46:24 -05:00
Fix permission issues after removing an account and refactor
This commit is contained in:
parent
5612965b45
commit
0c3d4f8405
@ -213,12 +213,9 @@ def forget_account(request, account_name):
|
||||
return redirect("about")
|
||||
else:
|
||||
key = [*accounts_dict][0]
|
||||
request.session['active_user'] = accounts_dict[key]['user']
|
||||
try:
|
||||
account = Account.objects.get(id=accounts_dict[key]['account_id'])
|
||||
request.session['active_username'] = account.username
|
||||
if switch_accounts(request, key):
|
||||
return redirect("accounts")
|
||||
except:
|
||||
else:
|
||||
request.session.flush()
|
||||
return redirect("about")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user