def sign_action(): name = request.form['name'] email = request.form['email'] password = request.form['password'] category = request.form['category'] hash_object = hashlib.sha1(email.encode()) hashc = hash_object.hexdigest()[-15:] link_map = {"Investor": '/capital', "Enterprise": "/company"} data = {} data['check'] = False print(hashc, name, email, category) if mongo.Register(email, name, password, category, hashc): data['check'] = True data['link'] = link_map[category] session['name'] = name session['category'] = category session['hash'] = hashc return data return data
def sign_action(): name = request.form['name'] email = request.form['email'] password = request.form['password'] category = request.form['category'] hash_object = hashlib.sha1(email.encode()) hashc = hash_object.hexdigest()[-15:] myc = {'Capitalist': 'investors', 'CE': 'enterprises', 'SME': 'sme'} link_map = {'SME': '/sme', 'CE': '/ce', "Capitalist": '/capital'} data = {} data['check'] = False print(name, email, password, category) if mongo.Register(email, name, password, category, hashc): utils.db.write_data(myc[category], { 'name': name, 'email': email }, hashc) data['check'] = True data['link'] = link_map[category] session['name'] = name session['category'] = category session['hash'] = hashc return data return data
def sign_action(): name = request.form['name'] email = request.form['email'] password = request.form['password'] Role = request.form['Role'] print(Role) if mongo.Register(email, name, password,Role): print("User Account Created") return "User Account Created" else: print("Error Occured") return "Error Occured"
def sign_action(): name = request.form['name'] email = request.form['email'] password = request.form['password'] print(name, email, password) data = {} if mongo.Register(email, name, password): session['email'] = email session['name'] = name data['check'] = True data['link'] = '/dashboard' return data
def RegisterUser(): name = request.form['name'] email = request.form['email'] password = request.form['password'] category = request.form['category'] print(name,email,password,category) data = {} if mongo.Register(email,name,password,category): session['email'] = email session['name'] = name session['category'] = category if category == "CloudProvider": data['link'] = '/CloudProvider' else: data['link'] = '/dashboard' data['check'] = True return data