diff --git a/rhodecode/apps/admin/views/defaults.py b/rhodecode/apps/admin/views/defaults.py --- a/rhodecode/apps/admin/views/defaults.py +++ b/rhodecode/apps/admin/views/defaults.py @@ -89,7 +89,7 @@ class AdminDefaultSettingsView(BaseAppVi html = formencode.htmlfill.render( data, defaults=errors.value, - errors=errors.error_dict or {}, + errors=errors.unpack_errors() or {}, prefix_error=False, encoding="UTF-8", force_defaults=False diff --git a/rhodecode/apps/admin/views/permissions.py b/rhodecode/apps/admin/views/permissions.py --- a/rhodecode/apps/admin/views/permissions.py +++ b/rhodecode/apps/admin/views/permissions.py @@ -123,7 +123,7 @@ class AdminPermissionsView(BaseAppView, html = formencode.htmlfill.render( data, defaults=defaults, - errors=errors.error_dict or {}, + errors=errors.unpack_errors() or {}, prefix_error=False, encoding="UTF-8", force_defaults=False @@ -194,7 +194,7 @@ class AdminPermissionsView(BaseAppView, html = formencode.htmlfill.render( data, defaults=defaults, - errors=errors.error_dict or {}, + errors=errors.unpack_errors() or {}, prefix_error=False, encoding="UTF-8", force_defaults=False @@ -287,7 +287,7 @@ class AdminPermissionsView(BaseAppView, html = formencode.htmlfill.render( data, defaults=defaults, - errors=errors.error_dict or {}, + errors=errors.unpack_errors() or {}, prefix_error=False, encoding="UTF-8", force_defaults=False diff --git a/rhodecode/apps/admin/views/repo_groups.py b/rhodecode/apps/admin/views/repo_groups.py --- a/rhodecode/apps/admin/views/repo_groups.py +++ b/rhodecode/apps/admin/views/repo_groups.py @@ -337,7 +337,7 @@ class AdminRepoGroupsView(BaseAppView, D html = formencode.htmlfill.render( data, defaults=errors.value, - errors=errors.error_dict or {}, + errors=errors.unpack_errors() or {}, prefix_error=False, encoding="UTF-8", force_defaults=False diff --git a/rhodecode/apps/admin/views/repositories.py b/rhodecode/apps/admin/views/repositories.py --- a/rhodecode/apps/admin/views/repositories.py +++ b/rhodecode/apps/admin/views/repositories.py @@ -228,7 +228,7 @@ class AdminReposView(BaseAppView, DataGr html = formencode.htmlfill.render( data, defaults=errors.value, - errors=errors.error_dict or {}, + errors=errors.unpack_errors() or {}, prefix_error=False, encoding="UTF-8", force_defaults=False diff --git a/rhodecode/apps/admin/views/settings.py b/rhodecode/apps/admin/views/settings.py --- a/rhodecode/apps/admin/views/settings.py +++ b/rhodecode/apps/admin/views/settings.py @@ -160,7 +160,7 @@ class AdminSettingsView(BaseAppView): html = formencode.htmlfill.render( data, defaults=errors.value, - errors=errors.error_dict or {}, + errors=errors.unpack_errors() or {}, prefix_error=False, encoding="UTF-8", force_defaults=False @@ -295,7 +295,7 @@ class AdminSettingsView(BaseAppView): html = formencode.htmlfill.render( data, defaults=errors.value, - errors=errors.error_dict or {}, + errors=errors.unpack_errors() or {}, prefix_error=False, encoding="UTF-8", force_defaults=False @@ -364,7 +364,7 @@ class AdminSettingsView(BaseAppView): html = formencode.htmlfill.render( data, defaults=errors.value, - errors=errors.error_dict or {}, + errors=errors.unpack_errors() or {}, prefix_error=False, encoding="UTF-8", force_defaults=False @@ -668,7 +668,7 @@ class AdminSettingsView(BaseAppView): html = formencode.htmlfill.render( data, defaults=errors.value, - errors=errors.error_dict or {}, + errors=errors.unpack_errors() or {}, prefix_error=False, encoding="UTF-8", force_defaults=False diff --git a/rhodecode/apps/admin/views/user_groups.py b/rhodecode/apps/admin/views/user_groups.py --- a/rhodecode/apps/admin/views/user_groups.py +++ b/rhodecode/apps/admin/views/user_groups.py @@ -234,7 +234,7 @@ class AdminUserGroupsView(BaseAppView, D html = formencode.htmlfill.render( data, defaults=errors.value, - errors=errors.error_dict or {}, + errors=errors.unpack_errors() or {}, prefix_error=False, encoding="UTF-8", force_defaults=False diff --git a/rhodecode/apps/admin/views/users.py b/rhodecode/apps/admin/views/users.py --- a/rhodecode/apps/admin/views/users.py +++ b/rhodecode/apps/admin/views/users.py @@ -106,7 +106,7 @@ class AdminUsersView(BaseAppView, DataGr base_inactive_q = base_q.filter(User.active != true()) if search_q: - like_expression = u'%{}%'.format(safe_unicode(search_q)) + like_expression = '%{}%'.format(safe_unicode(search_q)) base_q = base_q.filter(or_( User.username.ilike(like_expression), User._email.ilike(like_expression), @@ -216,14 +216,14 @@ class AdminUsersView(BaseAppView, DataGr html = formencode.htmlfill.render( data, defaults=errors.value, - errors=errors.error_dict or {}, + errors=errors.unpack_errors() or {}, prefix_error=False, encoding="UTF-8", force_defaults=False ) return Response(html) except UserCreationError as e: - h.flash(e, 'error') + h.flash(safe_unicode(e), 'error') except Exception: log.exception("Exception creation of user") h.flash(_('Error occurred during creation of user %s') @@ -340,14 +340,14 @@ class UsersView(UserAppView): html = formencode.htmlfill.render( data, defaults=errors.value, - errors=errors.error_dict or {}, + errors=errors.unpack_errors() or {}, prefix_error=False, encoding="UTF-8", force_defaults=False ) return Response(html) except UserCreationError as e: - h.flash(e, 'error') + h.flash(safe_unicode(e), 'error') except Exception: log.exception("Exception updating user") h.flash(_('Error occurred during update of user %s') @@ -636,7 +636,7 @@ class UsersView(UserAppView): html = formencode.htmlfill.render( data, defaults=errors.value, - errors=errors.error_dict or {}, + errors=errors.unpack_errors() or {}, prefix_error=False, encoding="UTF-8", force_defaults=False @@ -1026,7 +1026,8 @@ class UsersView(UserAppView): h.flash(_("Added new email address `%s` for user account") % email, category='success') except formencode.Invalid as error: - h.flash(h.escape(error.error_dict['email']), category='error') + msg = error.unpack_errors()['email'] + h.flash(h.escape(msg), category='error') except IntegrityError: log.warning("Email %s already exists", email) h.flash(_('Email `{}` is already registered for another user.').format(email), @@ -1117,7 +1118,7 @@ class UsersView(UserAppView): Session().commit() added.append(ip) except formencode.Invalid as error: - msg = error.error_dict['ip'] + msg = error.unpack_errors()['ip'] h.flash(msg, category='error') except Exception: log.exception("Exception during ip saving")