diff --git a/rhodecode/templates/login.html b/rhodecode/templates/login.html --- a/rhodecode/templates/login.html +++ b/rhodecode/templates/login.html @@ -56,10 +56,9 @@ ${h.checkbox('remember', value=True, checked=defaults.get('remember'))} - - %if h.HasPermissionAny('hg.password_reset.enable')(): + %if h.HasPermissionAny('hg.password_reset.enabled')():
- ${h.link_to(_('Forgot your password?'), h.route_path('reset_password'))} + ${h.link_to(_('Forgot your password?'), h.route_path('reset_password'), class_='pwd_reset')}
%elif h.HasPermissionAny('hg.password_reset.hidden')():diff --git a/rhodecode/tests/functional/test_admin_permissions.py b/rhodecode/tests/functional/test_admin_permissions.py --- a/rhodecode/tests/functional/test_admin_permissions.py +++ b/rhodecode/tests/functional/test_admin_permissions.py @@ -40,22 +40,22 @@ class TestAdminPermissionsController(Tes self.app.get(url('admin_permissions_application')) @pytest.mark.parametrize( - 'anonymous, default_register, default_register_message,' + 'anonymous, default_register, default_register_message, default_password_reset,' 'default_extern_activate, expect_error, expect_form_error', [ - (True, 'hg.register.none', '', 'hg.extern_activate.manual', + (True, 'hg.register.none', '', 'hg.password_reset.enabled', 'hg.extern_activate.manual', False, False), - (True, 'hg.register.manual_activate', '', 'hg.extern_activate.auto', + (True, 'hg.register.manual_activate', '', 'hg.password_reset.enabled', 'hg.extern_activate.auto', False, False), - (True, 'hg.register.auto_activate', '', 'hg.extern_activate.manual', + (True, 'hg.register.auto_activate', '', 'hg.password_reset.enabled', 'hg.extern_activate.manual', False, False), - (True, 'hg.register.auto_activate', '', 'hg.extern_activate.manual', + (True, 'hg.register.auto_activate', '', 'hg.password_reset.enabled', 'hg.extern_activate.manual', False, False), - (True, 'hg.register.XXX', '', 'hg.extern_activate.manual', + (True, 'hg.register.XXX', '', 'hg.password_reset.enabled', 'hg.extern_activate.manual', False, True), - (True, '', '', '', True, False), + (True, '', '', 'hg.password_reset.enabled', '', True, False), ]) def test_update_application_permissions( - self, anonymous, default_register, default_register_message, + self, anonymous, default_register, default_register_message, default_password_reset, default_extern_activate, expect_error, expect_form_error): self.log_user() @@ -66,6 +66,7 @@ class TestAdminPermissionsController(Tes 'anonymous': anonymous, 'default_register': default_register, 'default_register_message': default_register_message, + 'default_password_reset': default_password_reset, 'default_extern_activate': default_extern_activate, } response = self.app.post(url('admin_permissions_application'), diff --git a/rhodecode/tests/models/test_permissions.py b/rhodecode/tests/models/test_permissions.py --- a/rhodecode/tests/models/test_permissions.py +++ b/rhodecode/tests/models/test_permissions.py @@ -348,6 +348,7 @@ class TestPermissions(object): 'hg.create.none', 'hg.fork.none', 'hg.register.manual_activate', + 'hg.password_reset.enabled', 'hg.extern_activate.auto', 'repository.read', 'group.read', @@ -379,6 +380,7 @@ class TestPermissions(object): 'hg.create.repository', 'hg.fork.repository', 'hg.register.manual_activate', + 'hg.password_reset.enabled', 'hg.extern_activate.auto', 'repository.read', 'group.read', @@ -406,6 +408,7 @@ class TestPermissions(object): 'hg.create.none', 'hg.fork.none', 'hg.register.manual_activate', + 'hg.password_reset.enabled', 'hg.extern_activate.auto', 'repository.read', 'group.read',