aƱadido metodo set_password
authordanigm <dani@danigm.net>
Sat, 7 Nov 2009 18:19:21 +0000 (19:19 +0100)
committerdanigm <dani@danigm.net>
Sat, 7 Nov 2009 18:19:21 +0000 (19:19 +0100)
db.py

diff --git a/db.py b/db.py
index 628a2b8..c7daa7f 100644 (file)
--- a/db.py
+++ b/db.py
@@ -25,6 +25,9 @@ class User(Base):
 
     def __init__(self, name, password):
         self.name = unicode(name)
+        set_password(password)
+
+    def set_password(self, password):
         self.password = unicode(sha(password).hexdigest())
 
     def auth(self, password):