Make it possible to edit one’s profile

…even though it’s only one field yet.
This commit is contained in:
2018-07-11 09:37:26 +02:00
parent 1a69928241
commit c3348d3212
3 changed files with 46 additions and 0 deletions

View File

@@ -335,3 +335,16 @@ class FirstStepsForm(FlaskForm):
label=_('Your time zone'),
validators=[DataRequired()],
description=_('The start and end times of events will be displayed in this time zone.'))
class ProfileForm(FlaskForm):
"""Form for editing a user profile
"""
display_name = StringField(label=_('Display name'), validators=[DataRequired()])
def __init__(self, profile, *args, **kwargs):
kwargs.update({'display_name': profile.display_name})
FlaskForm.__init__(self, *args, **kwargs)
self.profile = profile