From 901fbd154f16268ca4c9d10af8d038d684c8c4f4 Mon Sep 17 00:00:00 2001 From: cedricbonhomme Date: Thu, 8 Nov 2012 23:08:35 +0100 Subject: Porting to Python 3.2. Better, faster, stronger. --- source/auth.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/auth.py') diff --git a/source/auth.py b/source/auth.py index 5e3243f4..5a6b5de6 100755 --- a/source/auth.py +++ b/source/auth.py @@ -62,11 +62,11 @@ def check_credentials(username, password): USERS[row[0]] = row[1] m = hashlib.sha1() - m.update(password) - if username in USERS.keys() and USERS[username] == m.hexdigest(): + m.update(password.encode()) + if username in list(USERS.keys()) and USERS[username] == m.hexdigest(): return None else: - return u"Incorrect username or password." + return "Incorrect username or password." # An example implementation which uses an ORM could be: # u = User.get(username) -- cgit