diff --git a/rhodecode/apps/admin/__init__.py b/rhodecode/apps/admin/__init__.py --- a/rhodecode/apps/admin/__init__.py +++ b/rhodecode/apps/admin/__init__.py @@ -611,7 +611,7 @@ def admin_routes(config): # user management config.add_route( name='user_edit', - pattern='/users/{user_id:\d+}/edit', + pattern=r'/users/{user_id:\d+}/edit', user_route=True) config.add_view( UsersView, @@ -621,7 +621,7 @@ def admin_routes(config): config.add_route( name='user_edit_advanced', - pattern='/users/{user_id:\d+}/edit/advanced', + pattern=r'/users/{user_id:\d+}/edit/advanced', user_route=True) config.add_view( UsersView, @@ -631,7 +631,7 @@ def admin_routes(config): config.add_route( name='user_edit_global_perms', - pattern='/users/{user_id:\d+}/edit/global_permissions', + pattern=r'/users/{user_id:\d+}/edit/global_permissions', user_route=True) config.add_view( UsersView, @@ -641,7 +641,7 @@ def admin_routes(config): config.add_route( name='user_edit_global_perms_update', - pattern='/users/{user_id:\d+}/edit/global_permissions/update', + pattern=r'/users/{user_id:\d+}/edit/global_permissions/update', user_route=True) config.add_view( UsersView, @@ -651,7 +651,7 @@ def admin_routes(config): config.add_route( name='user_update', - pattern='/users/{user_id:\d+}/update', + pattern=r'/users/{user_id:\d+}/update', user_route=True) config.add_view( UsersView, @@ -661,7 +661,7 @@ def admin_routes(config): config.add_route( name='user_delete', - pattern='/users/{user_id:\d+}/delete', + pattern=r'/users/{user_id:\d+}/delete', user_route=True) config.add_view( UsersView, @@ -671,7 +671,7 @@ def admin_routes(config): config.add_route( name='user_enable_force_password_reset', - pattern='/users/{user_id:\d+}/password_reset_enable', + pattern=r'/users/{user_id:\d+}/password_reset_enable', user_route=True) config.add_view( UsersView, @@ -681,7 +681,7 @@ def admin_routes(config): config.add_route( name='user_disable_force_password_reset', - pattern='/users/{user_id:\d+}/password_reset_disable', + pattern=r'/users/{user_id:\d+}/password_reset_disable', user_route=True) config.add_view( UsersView, @@ -691,7 +691,7 @@ def admin_routes(config): config.add_route( name='user_create_personal_repo_group', - pattern='/users/{user_id:\d+}/create_repo_group', + pattern=r'/users/{user_id:\d+}/create_repo_group', user_route=True) config.add_view( UsersView, @@ -702,7 +702,7 @@ def admin_routes(config): # user notice config.add_route( name='user_notice_dismiss', - pattern='/users/{user_id:\d+}/notice_dismiss', + pattern=r'/users/{user_id:\d+}/notice_dismiss', user_route=True) config.add_view( UsersView, @@ -713,7 +713,7 @@ def admin_routes(config): # user auth tokens config.add_route( name='edit_user_auth_tokens', - pattern='/users/{user_id:\d+}/edit/auth_tokens', + pattern=r'/users/{user_id:\d+}/edit/auth_tokens', user_route=True) config.add_view( UsersView, @@ -723,7 +723,7 @@ def admin_routes(config): config.add_route( name='edit_user_auth_tokens_view', - pattern='/users/{user_id:\d+}/edit/auth_tokens/view', + pattern=r'/users/{user_id:\d+}/edit/auth_tokens/view', user_route=True) config.add_view( UsersView, @@ -733,7 +733,7 @@ def admin_routes(config): config.add_route( name='edit_user_auth_tokens_add', - pattern='/users/{user_id:\d+}/edit/auth_tokens/new', + pattern=r'/users/{user_id:\d+}/edit/auth_tokens/new', user_route=True) config.add_view( UsersView, @@ -742,7 +742,7 @@ def admin_routes(config): config.add_route( name='edit_user_auth_tokens_delete', - pattern='/users/{user_id:\d+}/edit/auth_tokens/delete', + pattern=r'/users/{user_id:\d+}/edit/auth_tokens/delete', user_route=True) config.add_view( UsersView, @@ -752,7 +752,7 @@ def admin_routes(config): # user ssh keys config.add_route( name='edit_user_ssh_keys', - pattern='/users/{user_id:\d+}/edit/ssh_keys', + pattern=r'/users/{user_id:\d+}/edit/ssh_keys', user_route=True) config.add_view( UsersView, @@ -762,7 +762,7 @@ def admin_routes(config): config.add_route( name='edit_user_ssh_keys_generate_keypair', - pattern='/users/{user_id:\d+}/edit/ssh_keys/generate', + pattern=r'/users/{user_id:\d+}/edit/ssh_keys/generate', user_route=True) config.add_view( UsersView, @@ -772,7 +772,7 @@ def admin_routes(config): config.add_route( name='edit_user_ssh_keys_add', - pattern='/users/{user_id:\d+}/edit/ssh_keys/new', + pattern=r'/users/{user_id:\d+}/edit/ssh_keys/new', user_route=True) config.add_view( UsersView, @@ -781,7 +781,7 @@ def admin_routes(config): config.add_route( name='edit_user_ssh_keys_delete', - pattern='/users/{user_id:\d+}/edit/ssh_keys/delete', + pattern=r'/users/{user_id:\d+}/edit/ssh_keys/delete', user_route=True) config.add_view( UsersView, @@ -791,7 +791,7 @@ def admin_routes(config): # user emails config.add_route( name='edit_user_emails', - pattern='/users/{user_id:\d+}/edit/emails', + pattern=r'/users/{user_id:\d+}/edit/emails', user_route=True) config.add_view( UsersView, @@ -801,7 +801,7 @@ def admin_routes(config): config.add_route( name='edit_user_emails_add', - pattern='/users/{user_id:\d+}/edit/emails/new', + pattern=r'/users/{user_id:\d+}/edit/emails/new', user_route=True) config.add_view( UsersView, @@ -810,7 +810,7 @@ def admin_routes(config): config.add_route( name='edit_user_emails_delete', - pattern='/users/{user_id:\d+}/edit/emails/delete', + pattern=r'/users/{user_id:\d+}/edit/emails/delete', user_route=True) config.add_view( UsersView, @@ -820,7 +820,7 @@ def admin_routes(config): # user IPs config.add_route( name='edit_user_ips', - pattern='/users/{user_id:\d+}/edit/ips', + pattern=r'/users/{user_id:\d+}/edit/ips', user_route=True) config.add_view( UsersView, @@ -830,7 +830,7 @@ def admin_routes(config): config.add_route( name='edit_user_ips_add', - pattern='/users/{user_id:\d+}/edit/ips/new', + pattern=r'/users/{user_id:\d+}/edit/ips/new', user_route_with_default=True) # enabled for default user too config.add_view( UsersView, @@ -839,7 +839,7 @@ def admin_routes(config): config.add_route( name='edit_user_ips_delete', - pattern='/users/{user_id:\d+}/edit/ips/delete', + pattern=r'/users/{user_id:\d+}/edit/ips/delete', user_route_with_default=True) # enabled for default user too config.add_view( UsersView, @@ -849,7 +849,7 @@ def admin_routes(config): # user perms config.add_route( name='edit_user_perms_summary', - pattern='/users/{user_id:\d+}/edit/permissions_summary', + pattern=r'/users/{user_id:\d+}/edit/permissions_summary', user_route=True) config.add_view( UsersView, @@ -859,7 +859,7 @@ def admin_routes(config): config.add_route( name='edit_user_perms_summary_json', - pattern='/users/{user_id:\d+}/edit/permissions_summary/json', + pattern=r'/users/{user_id:\d+}/edit/permissions_summary/json', user_route=True) config.add_view( UsersView, @@ -870,7 +870,7 @@ def admin_routes(config): # user user groups management config.add_route( name='edit_user_groups_management', - pattern='/users/{user_id:\d+}/edit/groups_management', + pattern=r'/users/{user_id:\d+}/edit/groups_management', user_route=True) config.add_view( UsersView, @@ -880,7 +880,7 @@ def admin_routes(config): config.add_route( name='edit_user_groups_management_updates', - pattern='/users/{user_id:\d+}/edit/edit_user_groups_management/updates', + pattern=r'/users/{user_id:\d+}/edit/edit_user_groups_management/updates', user_route=True) config.add_view( UsersView, @@ -890,7 +890,7 @@ def admin_routes(config): # user audit logs config.add_route( name='edit_user_audit_logs', - pattern='/users/{user_id:\d+}/edit/audit', user_route=True) + pattern=r'/users/{user_id:\d+}/edit/audit', user_route=True) config.add_view( UsersView, attr='user_audit_logs', @@ -899,7 +899,7 @@ def admin_routes(config): config.add_route( name='edit_user_audit_logs_download', - pattern='/users/{user_id:\d+}/edit/audit/download', user_route=True) + pattern=r'/users/{user_id:\d+}/edit/audit/download', user_route=True) config.add_view( UsersView, attr='user_audit_logs_download', @@ -909,7 +909,7 @@ def admin_routes(config): # user caches config.add_route( name='edit_user_caches', - pattern='/users/{user_id:\d+}/edit/caches', + pattern=r'/users/{user_id:\d+}/edit/caches', user_route=True) config.add_view( UsersView, @@ -919,7 +919,7 @@ def admin_routes(config): config.add_route( name='edit_user_caches_update', - pattern='/users/{user_id:\d+}/edit/caches/update', + pattern=r'/users/{user_id:\d+}/edit/caches/update', user_route=True) config.add_view( UsersView, @@ -1057,7 +1057,7 @@ def includeme(config): # pr global redirect config.add_route( name='pull_requests_global_0', # backward compat - pattern=ADMIN_PREFIX + '/pull_requests/{pull_request_id:\d+}') + pattern=ADMIN_PREFIX + r'/pull_requests/{pull_request_id:\d+}') config.add_view( AdminMainView, attr='pull_requests', @@ -1065,7 +1065,7 @@ def includeme(config): config.add_route( name='pull_requests_global_1', # backward compat - pattern=ADMIN_PREFIX + '/pull-requests/{pull_request_id:\d+}') + pattern=ADMIN_PREFIX + r'/pull-requests/{pull_request_id:\d+}') config.add_view( AdminMainView, attr='pull_requests', @@ -1073,7 +1073,7 @@ def includeme(config): config.add_route( name='pull_requests_global', - pattern=ADMIN_PREFIX + '/pull-request/{pull_request_id:\d+}') + pattern=ADMIN_PREFIX + r'/pull-request/{pull_request_id:\d+}') config.add_view( AdminMainView, attr='pull_requests', diff --git a/rhodecode/apps/repository/__init__.py b/rhodecode/apps/repository/__init__.py --- a/rhodecode/apps/repository/__init__.py +++ b/rhodecode/apps/repository/__init__.py @@ -637,7 +637,7 @@ def includeme(config): # Pull Requests config.add_route( name='pullrequest_show', - pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}', + pattern=r'/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}', repo_route=True) config.add_view( RepoPullRequestsView, @@ -709,7 +709,7 @@ def includeme(config): config.add_route( name='pullrequest_update', - pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/update', + pattern=r'/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/update', repo_route=True, repo_forbid_when_archived=True) config.add_view( RepoPullRequestsView, @@ -719,7 +719,7 @@ def includeme(config): config.add_route( name='pullrequest_merge', - pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/merge', + pattern=r'/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/merge', repo_route=True, repo_forbid_when_archived=True) config.add_view( RepoPullRequestsView, @@ -729,7 +729,7 @@ def includeme(config): config.add_route( name='pullrequest_delete', - pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/delete', + pattern=r'/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/delete', repo_route=True, repo_forbid_when_archived=True) config.add_view( RepoPullRequestsView, @@ -739,7 +739,7 @@ def includeme(config): config.add_route( name='pullrequest_comment_create', - pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/comment', + pattern=r'/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/comment', repo_route=True) config.add_view( RepoPullRequestsView, @@ -749,7 +749,7 @@ def includeme(config): config.add_route( name='pullrequest_comment_edit', - pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/comment/{comment_id}/edit', + pattern=r'/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/comment/{comment_id}/edit', repo_route=True, repo_accepted_types=['hg', 'git']) config.add_view( RepoPullRequestsView, @@ -759,7 +759,7 @@ def includeme(config): config.add_route( name='pullrequest_comment_delete', - pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/comment/{comment_id}/delete', + pattern=r'/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/comment/{comment_id}/delete', repo_route=True, repo_accepted_types=['hg', 'git']) config.add_view( RepoPullRequestsView, @@ -769,7 +769,7 @@ def includeme(config): config.add_route( name='pullrequest_comments', - pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/comments', + pattern=r'/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/comments', repo_route=True) config.add_view( RepoPullRequestsView, @@ -779,7 +779,7 @@ def includeme(config): config.add_route( name='pullrequest_todos', - pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/todos', + pattern=r'/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/todos', repo_route=True) config.add_view( RepoPullRequestsView, @@ -789,7 +789,7 @@ def includeme(config): config.add_route( name='pullrequest_drafts', - pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/drafts', + pattern=r'/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/drafts', repo_route=True) config.add_view( RepoPullRequestsView, diff --git a/rhodecode/apps/user_group/__init__.py b/rhodecode/apps/user_group/__init__.py --- a/rhodecode/apps/user_group/__init__.py +++ b/rhodecode/apps/user_group/__init__.py @@ -16,10 +16,7 @@ # RhodeCode Enterprise Edition, including its added features, Support services, # and proprietary license terms, please see https://rhodecode.com/licenses/ - -from rhodecode.apps._base.navigation import NavigationRegistry from rhodecode.apps._base import ADMIN_PREFIX -from rhodecode.lib.utils2 import str2bool def admin_routes(config): @@ -30,7 +27,7 @@ def admin_routes(config): config.add_route( name='user_group_members_data', - pattern='/user_groups/{user_group_id:\d+}/members', + pattern=r'/user_groups/{user_group_id:\d+}/members', user_group_route=True) config.add_view( UserGroupsView, @@ -41,7 +38,7 @@ def admin_routes(config): # user groups perms config.add_route( name='edit_user_group_perms_summary', - pattern='/user_groups/{user_group_id:\d+}/edit/permissions_summary', + pattern=r'/user_groups/{user_group_id:\d+}/edit/permissions_summary', user_group_route=True) config.add_view( UserGroupsView, @@ -51,7 +48,7 @@ def admin_routes(config): config.add_route( name='edit_user_group_perms_summary_json', - pattern='/user_groups/{user_group_id:\d+}/edit/permissions_summary/json', + pattern=r'/user_groups/{user_group_id:\d+}/edit/permissions_summary/json', user_group_route=True) config.add_view( UserGroupsView, @@ -62,7 +59,7 @@ def admin_routes(config): # user groups edit config.add_route( name='edit_user_group', - pattern='/user_groups/{user_group_id:\d+}/edit', + pattern=r'/user_groups/{user_group_id:\d+}/edit', user_group_route=True) config.add_view( UserGroupsView, @@ -73,7 +70,7 @@ def admin_routes(config): # user groups update config.add_route( name='user_groups_update', - pattern='/user_groups/{user_group_id:\d+}/update', + pattern=r'/user_groups/{user_group_id:\d+}/update', user_group_route=True) config.add_view( UserGroupsView, @@ -83,7 +80,7 @@ def admin_routes(config): config.add_route( name='edit_user_group_global_perms', - pattern='/user_groups/{user_group_id:\d+}/edit/global_permissions', + pattern=r'/user_groups/{user_group_id:\d+}/edit/global_permissions', user_group_route=True) config.add_view( UserGroupsView, @@ -93,7 +90,7 @@ def admin_routes(config): config.add_route( name='edit_user_group_global_perms_update', - pattern='/user_groups/{user_group_id:\d+}/edit/global_permissions/update', + pattern=r'/user_groups/{user_group_id:\d+}/edit/global_permissions/update', user_group_route=True) config.add_view( UserGroupsView, @@ -103,7 +100,7 @@ def admin_routes(config): config.add_route( name='edit_user_group_perms', - pattern='/user_groups/{user_group_id:\d+}/edit/permissions', + pattern=r'/user_groups/{user_group_id:\d+}/edit/permissions', user_group_route=True) config.add_view( UserGroupsView, @@ -113,7 +110,7 @@ def admin_routes(config): config.add_route( name='edit_user_group_perms_update', - pattern='/user_groups/{user_group_id:\d+}/edit/permissions/update', + pattern=r'/user_groups/{user_group_id:\d+}/edit/permissions/update', user_group_route=True) config.add_view( UserGroupsView, @@ -123,7 +120,7 @@ def admin_routes(config): config.add_route( name='edit_user_group_advanced', - pattern='/user_groups/{user_group_id:\d+}/edit/advanced', + pattern=r'/user_groups/{user_group_id:\d+}/edit/advanced', user_group_route=True) config.add_view( UserGroupsView, @@ -133,7 +130,7 @@ def admin_routes(config): config.add_route( name='edit_user_group_advanced_sync', - pattern='/user_groups/{user_group_id:\d+}/edit/advanced/sync', + pattern=r'/user_groups/{user_group_id:\d+}/edit/advanced/sync', user_group_route=True) config.add_view( UserGroupsView, @@ -144,7 +141,7 @@ def admin_routes(config): # user groups delete config.add_route( name='user_groups_delete', - pattern='/user_groups/{user_group_id:\d+}/delete', + pattern=r'/user_groups/{user_group_id:\d+}/delete', user_group_route=True) config.add_view( UserGroupsView, @@ -156,4 +153,3 @@ def admin_routes(config): def includeme(config): # main admin routes config.include(admin_routes, route_prefix=ADMIN_PREFIX) -