Exemplo n.º 1
0
 def create_user(username, password, verify_password, email):
     val_errors = set()
     User.valid_username(username, val_errors)
     User.valid_password(password, val_errors)
     User.valid_verify(password, verify_password, val_errors)
     User.valid_email(email, val_errors)
     
     if val_errors:
         return None, val_errors
     else:
         return User(username = username, password = '******' % (hashing.make_pw_hash(username, password)), email = email), None
Exemplo n.º 2
0
 def create_user(cls, username, password, verify_password, email):
     val_errors = set()
     cls.valid_username(username, val_errors)
     cls.valid_password(password, val_errors)
     cls.valid_verify(password, verify_password, val_errors)
     cls.valid_email(email, val_errors)
     
     if val_errors:
         return None, val_errors
     else:
         mclient = memcache.Client()
         user = User(username=username, password='******' % (hashing.make_pw_hash(username, password)), email=email)
         user.put()
         memkey = cls._memkey_by_id(user.key().id())
         mclient.set(memkey, user)
         return user, None