def createaccount(): form = AccountForm.RegisterForm() formLogin = AccountForm.LoginForm() if request.method =='GET': return render_template('createaccount.html',form=form,formLogin=formLogin) if request.method =='POST': if request.form.get('login', None) == 'Login' : return AccountController.authenticatePopUpLogin(formLogin,'index') return AccountController.createuser(form=form, formLogin=formLogin)
def register(): template = None if request.method == 'GET': template = render_template('register.html', session=session) elif request.method == 'POST': # TODO passwordCheck if (request.form.get('emailAddress1') == request.form.get( 'emailAddress2')): print("emails correspond") else: print("emails don't correspond") if (request.form.get('password1') == request.form.get('password2')): print("passwords correspond") else: print("emails don't correspond") AccountController.createAccount(request.form.get('firstName'), request.form.get('lastName'), request.form.get('emailAddress1'), request.form.get('username'), request.form.get('password1')) return redirect(url_for('do_login')) return template
def createaccount(): form = AccountForm.RegisterForm() formLogin = AccountForm.LoginForm() if request.method == "GET": return render_template("createaccount.html", form=form, formLogin=formLogin) if request.method == "POST": if request.form.get("login", None) == "Login": return AccountController.authenticatePopUpLogin(formLogin, "index") return AccountController.createuser(form=form, formLogin=formLogin)
def index(): formLogin = AccountForm.LoginForm() if request.method == "GET": return render_template("index.html", formLogin=formLogin) if request.method == "POST": if request.form.get("login", None) == "Login": return AccountController.authenticatePopUpLogin(formLogin, "index")
def index(): formLogin = AccountForm.LoginForm() if request.method == 'GET' : return render_template('index.html',formLogin=formLogin) if request.method == 'POST' : if request.form.get('login', None) == 'Login' : return AccountController.authenticatePopUpLogin(formLogin,'index')
def checkout(): """ To address user pop up login , we have to pass formLogin to each page """ formLogin = AccountForm.LoginForm() if request.method == 'GET' : return render_template('checkout.html',formLogin=formLogin) if request.method == 'POST' : if request.form.get('login', None) == 'Login' : return AccountController.authenticatePopUpLogin(formLogin,'checkout')
def checkout(): """ To address user pop up login , we have to pass formLogin to each page """ formLogin = AccountForm.LoginForm() if request.method == "GET": return render_template("checkout.html", formLogin=formLogin) if request.method == "POST": if request.form.get("login", None) == "Login": return AccountController.authenticatePopUpLogin(formLogin, "checkout")
def login(): form = AccountForm.LoginForm() if request.method == 'GET' : if g.user.is_authenticated() == False: return render_template('login.html', form=form) if g.user.is_authenticated(): return redirect(url_for('index')) return AccountController.authenticate(form = form)
def login(): form = AccountForm.LoginForm() if request.method == "GET": # Check if user is already logged in, return login page if not, otherwise index if g.user.is_authenticated() == False: return render_template("login.html", form=form, formLogin=form) if g.user.is_authenticated(): return redirect(url_for("index")) return AccountController.authenticate(form=form)
def editaccount(): acct = AccountController(request) return acct.editaccount()
def login(): log = AccountController(request) return log.login()
def user_collections(title=None): userCol = AccountController(request) return userCol.collections()
def createaccount(): form = AccountForm.RegisterForm() if request.method =='GET': return render_template('createaccount.html',form=form) if request.method =='POST': return AccountController.createuser(form=form)
def createaccount(): acct = AccountController(request) return acct.createaccount()
def accountsuccess(): acct_suc = AccountController(request) acct_suc.accountsuccess()
def edit_collection(): userCol = AccountController(request) return userCol.editCollection()
def add_collection(username=None): add_coll = AccountController(request) return add_coll.add_collection()