def register_user(): email = request.form['email'] password = request.form['password'] username = request.form['username'] designation = request.form['designation'] block = request.form['block'] User.register(email, password, username, designation, block, department=None) user = User.get_by_email(email) if user.designation == 'HQ Staff': return render_template('profile_HQ.html', user=user) else: return render_template('profile_blocks.html', user=user)
def register_user(): email = request.form['email'] password = request.form['password'] User.register(email, password) session["email"] = email return render_template("profile.html", email=session['email'])
def registerNewUser(): email = request.form['email'] password = request.form['password'] if User.register(email,password) is not False: return render_template('profile.html', email=session['email']) else: return 'User already present in the App, Please login'
def register(): if request.method == 'POST': email = request.form['email'] password = request.form['password'] try: User.register(email, password) session['email'] = email flash("You just registered!", "success") return redirect(url_for('.index')) except UserErrors.UserError: flash("The current email is invalid or it has been registered.", "danger") except MailgunException: session['email'] = email flash(f"You just registered but not opted in to receive email from Mailgun. Please contact the " f"administrator.", "warning") return redirect(url_for('.index')) return render_template('register.html')