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

@@ -399,5 +399,21 @@ class CalendarSocialApp(Flask):
return render_template('first-steps.html', form=form)
@staticmethod
@route('/edit-profile', methods=['GET', 'POST'])
@login_required
def edit_profile():
from .forms import ProfileForm
from .models import db
form = ProfileForm(current_user.profile)
if form.validate_on_submit():
form.populate_obj(current_user.profile)
db.session.add(current_user.profile)
db.session.commit()
return render_template('profile-edit.html', form=form)
app = CalendarSocialApp(__name__)