Mercurial > public > sg101
diff wiki/middleware.py @ 841:47521d9e94bd
Fix unicode bug when setting wiki cookie.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sat, 04 Oct 2014 17:34:51 -0500 |
parents | efac466a05d4 |
children | ba3230aba90c |
line wrap: on
line diff
--- a/wiki/middleware.py Sat Oct 04 17:15:22 2014 -0500 +++ b/wiki/middleware.py Sat Oct 04 17:34:51 2014 -0500 @@ -25,7 +25,8 @@ # difficult for a spoofer; something that can't be easily made up: h = hashlib.sha256() - h.update(user.username + user.email) + h.update(user.username.encode('utf-8')) + h.update(user.email.encode('utf-8')) h.update(now.isoformat()) h.update(''.join(random.sample(string.printable, 64))) h.update(settings.SECRET_KEY)