1
0
mirror of https://github.com/django/django.git synced 2025-10-26 15:16:09 +00:00

[soc2009/multidb] Merged up to trunk r11858.

git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/multidb@11860 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Alex Gaynor
2009-12-13 22:15:08 +00:00
parent 049dc42bde
commit 2794cceb5f
53 changed files with 1658 additions and 1621 deletions

View File

@@ -1,7 +1,7 @@
import hmac
from django.conf import settings
from django.utils.hashcompat import sha_constructor
from django.utils.hashcompat import sha_hmac
from django.contrib.messages import constants
from django.contrib.messages.storage.base import BaseStorage, Message
from django.utils import simplejson as json
@@ -41,7 +41,6 @@ class MessageDecoder(json.JSONDecoder):
decoded = super(MessageDecoder, self).decode(s, **kwargs)
return self.process_messages(decoded)
class CookieStorage(BaseStorage):
"""
Stores messages in a cookie.
@@ -103,7 +102,7 @@ class CookieStorage(BaseStorage):
SECRET_KEY, modified to make it unique for the present purpose.
"""
key = 'django.contrib.messages' + settings.SECRET_KEY
return hmac.new(key, value, sha_constructor).hexdigest()
return hmac.new(key, value, sha_hmac).hexdigest()
def _encode(self, messages, encode_empty=False):
"""