# HG changeset patch # User Martin Bornhold # Date 2016-10-26 12:55:33 # Node ID 64aae6b31ff44c59db23aae169ed9c46f2e4e797 # Parent 9a1fddb4ee49e962a979459e2017d9da123c50b9 login: Make register views more robust if some POST parameters are missing. We fail to delete passsword/password confirm parameters if they are not part of the POST parameters. But failing to delete them if they are not present seems wrong. Better silently ignore if they are not present. diff --git a/rhodecode/login/views.py b/rhodecode/login/views.py --- a/rhodecode/login/views.py +++ b/rhodecode/login/views.py @@ -172,7 +172,7 @@ class LoginView(object): except formencode.Invalid as errors: defaults = errors.value # remove password from filling in form again - del defaults['password'] + defaults.pop('password', None) render_ctx = self._get_template_context() render_ctx.update({ 'errors': errors.error_dict, @@ -260,8 +260,8 @@ class LoginView(object): raise HTTPFound(redirect_ro) except formencode.Invalid as errors: - del errors.value['password'] - del errors.value['password_confirmation'] + errors.value.pop('password', None) + errors.value.pop('password_confirmation', None) return self.register( defaults=errors.value, errors=errors.error_dict)