1
0
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:
Jason McBrayer 2019-04-27 20:32:09 -04:00
parent 5612965b45
commit 0c3d4f8405

View File

@ -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")