mirror of
http://git.carcosa.net/jmcbray/brutaldon.git
synced 2024-11-23 15:23:52 -05:00
Add accounts_dict to session, update it on logging in.
This commit is contained in:
parent
d911da51bc
commit
ebf58264e8
@ -300,8 +300,16 @@ def oauth_callback(request):
|
||||
client = Client.objects.get(api_base_id=request.session['active_instance']),
|
||||
preferences = preferences)
|
||||
account.save()
|
||||
|
||||
request.session['active_user'] = user
|
||||
request.session['active_username'] = user.username + '@' + request.session['active_instance_hostname']
|
||||
|
||||
accounts_dict = request.session.get('accounts_dict')
|
||||
if not accounts_dict:
|
||||
accounts_dict = {}
|
||||
accounts_dict[account.username] = { account_id: account.id, user: user }
|
||||
request.session['accounts_dict'] = accounts_dict
|
||||
|
||||
return redirect(home)
|
||||
|
||||
|
||||
@ -365,6 +373,13 @@ def old_login(request):
|
||||
account.username = request.session['active_username']
|
||||
request.session['timezone'] = account.preferences.timezone;
|
||||
account.save()
|
||||
|
||||
accounts_dict = request.session.get('accounts_dict')
|
||||
if not accounts_dict:
|
||||
accounts_dict = {}
|
||||
accounts_dict[account.username] = { account_id: account.id, user: user }
|
||||
request.session['accounts_dict'] = accounts_dict
|
||||
|
||||
return redirect(home)
|
||||
|
||||
except Exception as ex:
|
||||
|
Loading…
Reference in New Issue
Block a user