diff options
author | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2016-10-07 10:59:54 +0200 |
---|---|---|
committer | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2016-10-07 10:59:54 +0200 |
commit | c4eadb099283af409b13146554abf9e5a0cb49a6 (patch) | |
tree | 46cc6357bf50fc9ba884b346e4cd6fd8fcda7ad7 /src/web/views | |
parent | Redirect to the dashboard. (diff) | |
download | newspipe-c4eadb099283af409b13146554abf9e5a0cb49a6.tar.gz newspipe-c4eadb099283af409b13146554abf9e5a0cb49a6.tar.bz2 newspipe-c4eadb099283af409b13146554abf9e5a0cb49a6.zip |
Some other new update for the public profile page.
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: |