diff options
Diffstat (limited to 'src/web/views')
-rw-r--r-- | src/web/views/user.py | 11 |
1 files changed, 8 insertions, 3 deletions
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: |