aƱadido metodo set_password
[webpysample.git] / 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):