def register(): if request.method == 'GET': return render_template('register.html', error=None) accountDao = AccountDao() code = accountDao.add_account(request.form['user'], request.form['password'], request.form['name']) if not code: return render_template('register.html', error="User Account Existed Already") # TODO: send email with authentication url ending with code return redirect(url_for('PetCare.login'))
def register(): if request.method == 'GET': return render_template('register.html', error=None) accountInfo = Entities.make_account_info(request) if not accountInfo: return render_template('register.html', error="Required Informaion Missing") accountDao = AccountDao() isNewAccount = accountDao.add_account(accountInfo) if not isNewAccount: return render_template('register.html', error="User Account Existed Already") EmailHandler.send_authentication(accountInfo['email'], accountInfo['id'], accountInfo['code']) return redirect(url_for('PetCare.login'))
def register(): if request.method == 'GET': return render_template('register.html', error=None) accountInfo = Entities.make_account_info(request) if not accountInfo: return render_template('register.html', error="Required Informaion Missing") accountDao = AccountDao() isNewAccount = accountDao.add_account(accountInfo) if not isNewAccount: return render_template('register.html', error="User Account Existed Already") # TODO: send email with authentication url ending with code return redirect(url_for('PetCare.login'))