forked from 0x2620/pandora
keep session data and ui state on signup. fixes #898
This commit is contained in:
parent
f5003f9613
commit
78bb1cc0ed
1 changed files with 8 additions and 1 deletions
|
@ -170,9 +170,16 @@ def signup(request):
|
|||
if key in l:
|
||||
setattr(list, key, l[key])
|
||||
list.save()
|
||||
|
||||
if request.session.session_key:
|
||||
models.SessionData.objects.filter(session_key=request.session.session_key).update(user=user)
|
||||
ui = json.loads(request.session.get('ui', 'null'))
|
||||
user = authenticate(username=data['username'],
|
||||
password=data['password'])
|
||||
if ui:
|
||||
profile = user.get_profile()
|
||||
profile.ui = ui
|
||||
profile.save()
|
||||
|
||||
login(request, user)
|
||||
user_json = models.init_user(user, request)
|
||||
response = json_response({
|
||||
|
|
Loading…
Reference in a new issue