Exemple #1
0
def save_user(user):
    o = Account()
    o.f_name = str(user['first_name'])
    o.l_name = str(user['last_name'])
    o.user_id = str(user['username'])
    o.email_address = str(user['email_address'])
    o.secret = str(user['secret'])
    o.otp_salt = str(user['otp_salt'])
    o.passwd_salt = str(crypto.gen_salt())
    o.password = crypto.secure_pw(str(user['password']),o.passwd_salt,fast=True)
    o.save()
    return o
Exemple #2
0
def save_user(user):
    o = Account()
    o.f_name = str(user['first_name'])
    o.l_name = str(user['last_name'])
    o.user_id = str(user['username'])
    o.email_address = str(user['email_address'])
    o.secret = str(user['secret'])
    o.otp_salt = str(user['otp_salt'])
    o.passwd_salt = str(crypto.gen_salt())
    o.password = crypto.secure_pw(str(user['password']),
                                  o.passwd_salt,
                                  fast=True)
    o.save()
    return o