def register_method(): if request.method == 'POST': name = request.form['InputName'] account = request.form['InputAccount'] password = request.form['InputPassword'] result = User.register_user(name, account, password) if result is True: session['account'] = account session['name'] = User.find_user_data(account).get('Name') return redirect("/") else: message = "Ur account is already existed !!" return render_template('register.html', message=message) else: return render_template('register.html')
def register(): if request.method == 'POST': name = request.form['InputName'] email = request.form['InputEmail'] password = request.form['InputPassword'] result = User.register_user(name, email, password) if result is True: session['email'] = email session['name'] = name return redirect("/") else: message = "This email is already existed" return render_template("register.html", message=message) else: return render_template("register.html")
def register(): if request.method == 'POST': name = request.form['InputName'] email = request.form['InputEmail'] password = request.form['InputPassword'] result = User.register_user(name, email, password) if result is True: session['email'] = email session['name'] = name return redirect("/") else: message = "This email is already existed" return render_template("register.html", message=message) else: return render_template("register.html")
def register(): if request.method == 'POST': name = request.form['InputName'] email = request.form['InputEmail'] password = request.form['InputPassword'] result = User.register_user(name, email, password) if result: session['email'] = email session['name'] = name return redirect('/') else: message = "该电子信箱已存在。" return render_template("register.html", message=message) else: return render_template("register.html")
def register_method(): session['inLoginPage'] = False session['inRegisterPage'] = True if request.method == 'POST': name = request.form['InputName'] account = request.form['InputAccount'] password = request.form['InputPassword'] result = User.register_user(name, account, password) if result == True: session['account'] = account session['name'] = User.find_user_data(account).get('name') return redirect("/") else: message = "Your account is already exist !!" return render_template("register.html", message=message) else: return render_template("register.html")
def register(): form = RegisterForm() if request.method == 'POST': name = request.form['name'] username = request.form['username'] password = request.form['password'] age = request.form['age'] height = request.form['height'] weight = request.form['weight'] gender = request.form['gender'] register_success = User.register_user(username, password, name, age, height, weight, gender) unsuccessful = 'Failed to register account! Check if formats are valid! Check if password is long enough! Email may already be registered! There cannot be empty Fields!' if name == "" or age == "" or height == "" or weight == "": return render_template('register.html', title='Register', form=form, alertmessage=unsuccessful) if register_success: # Successful Registration return render_template( 'register.html', title='Register', form=form, successmessage='Successfully Registered Account!') else: # Failed Registration return render_template('register.html', title='Register', form=form, alertmessage=unsuccessful) if form.validate_on_submit(): flash('Login requested for user {}, remember_me={}'.format( form.username.data, form.remember_me.data)) return redirect('/index', name=name) return render_template('register.html', title='Register', form=form)
def register(): """ 页面:用户注册 :return: """ if request.method == 'POST': # 接受表单信息,进行注册 name = request.form["InputName"] email = request.form["InputEmail"] password = request.form["InputPassword"] result = User.register_user(name, email, password) if result is True: # 转跳到home页 session['email'] = email session['name'] = name return redirect('/') else: message = "这个email已经存在" return render_template("register.html", message=message) else: return render_template("register.html")