Added missing import to [230]

git-svn-id: http://code.djangoproject.com/svn/django/trunk@231 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2005-07-20 00:43:39 +00:00
parent 897d24b220
commit 49fbe711cc
1 changed files with 1 additions and 0 deletions

View File

@ -213,6 +213,7 @@ class Session(meta.Model):
raise SessionDoesNotExist raise SessionDoesNotExist
session_md5, tamper_check = session_cookie_string[:32], session_cookie_string[32:] session_md5, tamper_check = session_cookie_string[:32], session_cookie_string[32:]
if md5.new(session_md5 + SECRET_KEY + 'auth').hexdigest() != tamper_check: if md5.new(session_md5 + SECRET_KEY + 'auth').hexdigest() != tamper_check:
from django.core.exceptions import SuspiciousOperation
raise SuspiciousOperation, "User may have tampered with session cookie." raise SuspiciousOperation, "User may have tampered with session cookie."
return get_object(session_md5__exact=session_md5, select_related=True) return get_object(session_md5__exact=session_md5, select_related=True)