Reviewers: bch,


Please review this at http://codereview.appspot.com/122044

Affected files:
   M trytond/res/user.py
   M trytond/security.py


Index: trytond/res/user.py
===================================================================
--- a/trytond/res/user.py
+++ b/trytond/res/user.py
@@ -389,6 +389,8 @@
          if not user_id:
              return 0
          password += salt or ''
+        if isinstance(password, unicode):
+            password = password.encode('utf-8')
          if hashlib:
              password_sha = hashlib.sha1(password).hexdigest()
          else:
Index: trytond/security.py
===================================================================
--- a/trytond/security.py
+++ b/trytond/security.py
@@ -20,6 +20,7 @@
      if not dbname in database_list:
          pool.init()
      user_obj = pool.get('res.user')
+    password = password.decode('utf-8')
      user_id = user_obj.get_login(cursor, 0, loginname, password)
      cursor.commit()
      cursor.close()



--~--~---------~--~----~------------~-------~--~----~
[email protected] mailing list
-~----------~----~----~----~------~----~------~--~---

Reply via email to