one more if

remotes/origin/yandex
Bachurin Sergey 12 years ago
parent 711ed38809
commit 9cc0a88bb7
  1. 2
      project/customer/middleware.py

@ -16,7 +16,7 @@ class ProfileMiddleware(object):
def process_request(self, request):
assert hasattr(request, 'user'), "The Profile middleware requires authentication middleware to be installed. Edit your MIDDLEWARE_CLASSES setting to insert 'django.contrib.auth.middleware.AuthenticationMiddleware'."
request.profile = SimpleLazyObject(lambda: _get_profile(request))
if request.user.is_authenticated():
if request.user.is_authenticated() and request.session:
if request.user.profile.user_session_key != request.session.session_key and \
request.profile.user_session_key != '':
django_logout(request)

Loading…
Cancel
Save