flashingpumpkin/django-socialregistration — Issue #132: KeyError: 'socialreg:user' when deleting session keys
Author: diafygi
Created: 2011-12-12 09:35:07+00:00
State: open

Traceback (most recent call last):

File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 111, in get_response
response = callback(request, *callback_args, **callback_kwargs)

File "/usr/local/lib/python2.7/dist-packages/django/views/generic/base.py", line 47, in view
return self.dispatch(request, *args, **kwargs)

File "/usr/local/lib/python2.7/dist-packages/django/views/generic/base.py", line 68, in dispatch
return handler(request, *args, **kwargs)

File "/socialregistration/views.py", line 100, in get
return self.generate_username_and_redirect(request, user, profile, client)

File "/socialregistration/views.py", line 84, in generate_username_and_redirect
self.delete_session_data(request)

File "/socialregistration/mixins.py", line 190, in delete_session_data
del request.session['%suser' % SESSION_KEY]

File "/usr/local/lib/python2.7/dist-packages/django/contrib/sessions/backends/base.py", line 54, in __delitem__
del self._session[key]

KeyError: 'socialreg:user'
------------------------------------

Been getting the above error occasionally when someone tries to register through facebook or twitter. It appears to be trying to delete the session key, so could we just let it pass if that key doesn't exist?