Validate registration process. Change copyright year.

This commit is contained in:
Khanh Ngo 2018-04-18 13:16:02 +07:00
parent bd45c4ef87
commit 3d8d94f280
3 changed files with 6 additions and 3 deletions

View File

@ -116,7 +116,7 @@
</div>
<!-- /.login-box-body -->
<div class="login-box-footer">
<center><p>2016 &copy; Khanh Ngo</p></center>
<center><p>2018 &copy; Khanh Ngo</p></center>
</div>
</div>
<!-- /.login-box -->

View File

@ -84,7 +84,7 @@
</div>
<!-- /.form-box -->
<div class="login-box-footer">
<center><p>2016 &copy; Khanh Ngo</p></center>
<center><p>2018 &copy; Khanh Ngo</p></center>
</div>
</div>
<!-- /.login-box -->

View File

@ -389,13 +389,16 @@ def login():
login_user(user, remember = remember_me)
return redirect(request.args.get('next') or url_for('index'))
else:
if not username or not password or not email:
return render_template('register.html', error='Please input required information')
# registration case
user = User(username=username, plain_text_password=password, firstname=firstname, lastname=lastname, email=email)
# TODO: Move this into the JavaScript
# validate password and password confirmation
if password != rpassword:
error = "Passsword and confirmation do not match"
error = "Password confirmation does not match"
return render_template('register.html', error=error)
try: