mirror of
https://gitlab.com/brutaldon/brutaldon.git
synced 2024-12-04 14:46:24 -05:00
Fix a 500 error on repeat login
This commit is contained in:
parent
52efb4a1d7
commit
816458a86a
@ -200,14 +200,12 @@ def oauth_callback(request):
|
||||
except (Account.DoesNotExist, Account.MultipleObjectsReturned):
|
||||
preferences = Preference(theme = Theme.objects.get(id=1))
|
||||
preferences.save()
|
||||
account = Account(username=user.acct,
|
||||
account = Account(username=user.username + '@' + request.session['instance_hostname'],
|
||||
access_token = access_token,
|
||||
client = Client.objects.get(api_base_id=request.session['instance']),
|
||||
preferences = preferences)
|
||||
request.session['user'] = user
|
||||
request.session['username'] = user.username + '@' + request.session['instance_hostname']
|
||||
account.username = user.username + '@' + request.session['instance_hostname']
|
||||
account.save()
|
||||
return redirect(home)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user