From c4eadb099283af409b13146554abf9e5a0cb49a6 Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Fri, 7 Oct 2016 10:59:54 +0200 Subject: Some other new update for the public profile page. --- src/web/views/user.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/web/views') diff --git a/src/web/views/user.py b/src/web/views/user.py index 26d65de3..3e203b3e 100644 --- a/src/web/views/user.py +++ b/src/web/views/user.py @@ -103,16 +103,21 @@ def profile(): if request.method == 'POST': if form.validate(): - user_contr.update({'id': current_user.id}, + try: + user_contr.update({'id': current_user.id}, {'nickname': form.nickname.data, 'email': form.email.data, 'password': form.password.data, 'automatic_crawling': form.automatic_crawling.data, 'is_public_profile': form.is_public_profile.data, + 'bio': form.bio.data, 'webpage': form.webpage.data, 'twitter': form.twitter.data}) - - flash(gettext('User %(nick)s successfully updated', + except Exception as error: + flash(gettext('Problem while updating your profile: ' + '%(error)s', error=error), 'danger') + else: + flash(gettext('User %(nick)s successfully updated', nick=user.nickname), 'success') return redirect(url_for('user.profile')) else: -- cgit