magic-removal: More various fixes
git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@1649 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
47a0ec00f2
commit
ecc57b0b07
|
@ -103,7 +103,7 @@ class ModPythonRequest(httpwrappers.HttpRequest):
|
|||
if not user_id:
|
||||
raise ValueError
|
||||
self._user = User.objects.get_object(pk=user_id)
|
||||
except (AttributeError, KeyError, ValueError, user.DoesNotExist):
|
||||
except (AttributeError, KeyError, ValueError, User.DoesNotExist):
|
||||
from django.parts.auth import anonymoususers
|
||||
self._user = anonymoususers.AnonymousUser()
|
||||
return self._user
|
||||
|
|
|
@ -124,7 +124,7 @@ class WSGIRequest(httpwrappers.HttpRequest):
|
|||
if not user_id:
|
||||
raise ValueError
|
||||
self._user = User.objects.get_object(pk=user_id)
|
||||
except (AttributeError, KeyError, ValueError, user.DoesNotExist):
|
||||
except (AttributeError, KeyError, ValueError, User.DoesNotExist):
|
||||
from django.parts.auth import anonymoususers
|
||||
self._user = anonymoususers.AnonymousUser()
|
||||
return self._user
|
||||
|
|
|
@ -81,12 +81,12 @@ class SessionManager(models.Manager):
|
|||
session_key = md5.new(str(random.randint(0, sys.maxint - 1)) + SECRET_KEY).hexdigest()
|
||||
try:
|
||||
self.get_object(session_key__exact=session_key)
|
||||
except SessionDoesNotExist:
|
||||
except self.klass.DoesNotExist:
|
||||
break
|
||||
return session_key
|
||||
|
||||
def save(self, session_key, session_dict, expire_date):
|
||||
s = self.klass(session_key, encode(session_dict), expire_date)
|
||||
s = self.klass(session_key, self.encode(session_dict), expire_date)
|
||||
if session_dict:
|
||||
s.save()
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue