From 21fdf7e0abe0ca3ab6bea179ffe40b4a657705ef Mon Sep 17 00:00:00 2001 From: Keith Mitchell Date: Thu, 6 Dec 2012 16:33:22 -0800 Subject: [PATCH] Fix canonical_email for addresses with utf-8 --- r2/r2/models/account.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/r2/r2/models/account.py b/r2/r2/models/account.py index ac8b2c69d..8cefb2f87 100644 --- a/r2/r2/models/account.py +++ b/r2/r2/models/account.py @@ -570,7 +570,7 @@ class Account(Thing): return which.get(canon, None) def canonical_email(self): - email = str(self.email.lower()) + email = self.email.lower().encode('utf-8') if email.count("@") != 1: return "invalid@invalid.invalid"