# HG changeset patch # User Brian Neal # Date 1412462091 18000 # Node ID 47521d9e94bd3eb311e489c2d756cacab9d54c5d # Parent 7735f8a6bd1fe144d46be520768d600ad910049b Fix unicode bug when setting wiki cookie. diff -r 7735f8a6bd1f -r 47521d9e94bd wiki/middleware.py --- 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)