Author: aaugustin
Date: 2011-10-16 02:46:01 -0700 (Sun, 16 Oct 2011)
New Revision: 16993

Modified:
   django/trunk/django/contrib/auth/tokens.py
Log:
Fixed a test that was broken at r16978. Refs #17055.


Modified: django/trunk/django/contrib/auth/tokens.py
===================================================================
--- django/trunk/django/contrib/auth/tokens.py  2011-10-16 06:57:25 UTC (rev 
16992)
+++ django/trunk/django/contrib/auth/tokens.py  2011-10-16 09:46:01 UTC (rev 
16993)
@@ -52,8 +52,12 @@
         # invalid as soon as it is used.
         # We limit the hash to 20 chars to keep URL short
         key_salt = "django.contrib.auth.tokens.PasswordResetTokenGenerator"
+
+        # Ensure results are consistent across DB backends
+        login_timestamp = user.last_login.replace(microsecond=0, tzinfo=None)
+
         value = (unicode(user.id) + user.password +
-                unicode(user.last_login) + unicode(timestamp))
+                unicode(login_timestamp) + unicode(timestamp))
         hash = salted_hmac(key_salt, value).hexdigest()[::2]
         return "%s-%s" % (ts_b36, hash)
 

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to