aboutsummaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2018-03-18 18:14:55 +0000
committerrubenwardy <rw@rubenwardy.com>2018-03-18 18:14:55 +0000
commit84f123a0ab529ac8a649e0e0ca4a49fd0c828db3 (patch)
tree90e473f075c52107941ea8038307a93f7189fa8c /app/views
parent7d20c49ebb2a59e54a77ab92f268acd7fe069383 (diff)
downloadcheatdb-84f123a0ab529ac8a649e0e0ca4a49fd0c828db3.tar.xz
Fix profile page
Diffstat (limited to 'app/views')
-rw-r--r--app/views/users.py12
1 files changed, 3 insertions, 9 deletions
diff --git a/app/views/users.py b/app/views/users.py
index 99cf19c..1dc5e29 100644
--- a/app/views/users.py
+++ b/app/views/users.py
@@ -13,17 +13,11 @@ from flask_user.forms import RegisterForm
from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField, validators
class MyRegisterForm(RegisterForm):
- first_name = StringField('First name', validators=[
- validators.DataRequired('First name is required')])
- last_name = StringField('Last name', validators=[
- validators.DataRequired('Last name is required')])
+ display_name = StringField("Diplay name")
# Define the User profile form
class UserProfileForm(FlaskForm):
- first_name = StringField('First name', validators=[
- validators.DataRequired('First name is required')])
- last_name = StringField('Last name', validators=[
- validators.DataRequired('Last name is required')])
+ display_name = StringField("Diplay name")
submit = SubmitField('Save')
@app.route('/user/', methods=['GET', 'POST'])
@@ -42,7 +36,7 @@ def user_profile_page(username=None):
if user == current_user:
# Initialize form
- form = UserProfileForm(request.form, current_user)
+ form = UserProfileForm(formdata=request.form, obj=current_user)
# Process valid POST
if request.method=='POST' and form.validate():