From 78bb1cc0ed4c0330df626cbed65bfbba16f36fc0 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sun, 1 Jul 2012 21:03:47 +0200 Subject: [PATCH] keep session data and ui state on signup. fixes #898 --- pandora/user/views.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pandora/user/views.py b/pandora/user/views.py index 3f915671c..cd8c32b17 100644 --- a/pandora/user/views.py +++ b/pandora/user/views.py @@ -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({