admin: Use error message from UserCreationError when updating a user.

If we get a UserCreationError on updating a user we should display the
more specific error message from the exception.
This commit is contained in:
Johannes Bornhold 2016-05-30 12:16:25 +02:00
parent 23ac9de853
commit b23f4f5b5d

View file

@ -216,6 +216,8 @@ class UsersController(BaseController):
prefix_error=False,
encoding="UTF-8",
force_defaults=False)
except UserCreationError as e:
h.flash(e, 'error')
except Exception:
log.exception("Exception updating user")
h.flash(_('Error occurred during update of user %s')