From 0b2c148765eafa796a1a464e9f47cef54e414cff Mon Sep 17 00:00:00 2001 From: Marcin Kuzminski Date: Wed, 12 Jul 2017 23:46:34 +0200 Subject: [PATCH] pyramid: stop relying on global mako url() function. - use only the helpers method --- rhodecode/subscribers.py | 1 - .../templates/admin/defaults/defaults_repositories.mako | 2 +- .../templates/admin/notifications/notifications.mako | 2 +- .../templates/admin/notifications/notifications_data.mako | 2 +- .../templates/admin/notifications/show_notification.mako | 4 ++-- .../admin/permissions/permissions_application.mako | 2 +- .../templates/admin/permissions/permissions_global.mako | 2 +- .../templates/admin/permissions/permissions_objects.mako | 2 +- rhodecode/templates/admin/repo_groups/repo_group_add.mako | 2 +- .../admin/repo_groups/repo_group_edit_perms.mako | 2 +- .../admin/repo_groups/repo_group_edit_settings.mako | 2 +- rhodecode/templates/admin/repos/repo_add_base.mako | 2 +- rhodecode/templates/admin/repos/repo_edit_fields.mako | 4 ++-- .../templates/admin/repos/repo_edit_issuetracker.mako | 8 ++++---- rhodecode/templates/admin/repos/repo_edit_remote.mako | 2 +- rhodecode/templates/admin/repos/repo_edit_statistics.mako | 2 +- rhodecode/templates/admin/repos/repo_edit_vcs.mako | 2 +- rhodecode/templates/admin/settings/settings_email.mako | 2 +- rhodecode/templates/admin/settings/settings_global.mako | 2 +- rhodecode/templates/admin/settings/settings_hooks.mako | 2 +- .../templates/admin/settings/settings_issuetracker.mako | 8 ++++---- rhodecode/templates/admin/settings/settings_labs.mako | 2 +- rhodecode/templates/admin/settings/settings_mapping.mako | 2 +- rhodecode/templates/admin/settings/settings_vcs.mako | 2 +- rhodecode/templates/admin/settings/settings_visual.mako | 2 +- rhodecode/templates/admin/user_groups/user_group_add.mako | 2 +- .../admin/user_groups/user_group_edit_global_perms.mako | 2 +- .../admin/user_groups/user_group_edit_perms.mako | 2 +- .../admin/user_groups/user_group_edit_settings.mako | 2 +- rhodecode/templates/admin/users/user_add.mako | 2 +- .../templates/admin/users/user_edit_global_perms.mako | 2 +- rhodecode/templates/admin/users/user_edit_profile.mako | 2 +- rhodecode/templates/base/default_perms_box.mako | 2 +- rhodecode/templates/changeset/changeset.mako | 2 +- rhodecode/templates/forks/fork.mako | 2 +- rhodecode/templates/pullrequests/pullrequest.mako | 2 +- .../templates/pullrequests/pullrequest_merge_checks.mako | 2 +- rhodecode/templates/pullrequests/pullrequest_show.mako | 4 ++-- 38 files changed, 46 insertions(+), 47 deletions(-) diff --git a/rhodecode/subscribers.py b/rhodecode/subscribers.py index 623f37bd..bf9815a3 100644 --- a/rhodecode/subscribers.py +++ b/rhodecode/subscribers.py @@ -54,7 +54,6 @@ def add_renderer_globals(event): # Put pylons stuff into the context. This will be removed as soon as # migration to pyramid is finished. event['c'] = pylons.tmpl_context - event['url'] = pylons.url # TODO: When executed in pyramid view context the request is not available # in the event. Find a better solution to get the request. diff --git a/rhodecode/templates/admin/defaults/defaults_repositories.mako b/rhodecode/templates/admin/defaults/defaults_repositories.mako index d668cb35..81b2586a 100644 --- a/rhodecode/templates/admin/defaults/defaults_repositories.mako +++ b/rhodecode/templates/admin/defaults/defaults_repositories.mako @@ -3,7 +3,7 @@

${_('Default Settings For New Repositories')}

- ${h.secure_form(url('admin_defaults_repositories'), method='post')} + ${h.secure_form(h.url('admin_defaults_repositories'), method='post')}
diff --git a/rhodecode/templates/admin/notifications/notifications.mako b/rhodecode/templates/admin/notifications/notifications.mako index c887a94a..686c3af3 100644 --- a/rhodecode/templates/admin/notifications/notifications.mako +++ b/rhodecode/templates/admin/notifications/notifications.mako @@ -44,7 +44,7 @@
diff --git a/rhodecode/templates/forks/fork.mako b/rhodecode/templates/forks/fork.mako index 8fd25a28..366c1fe4 100644 --- a/rhodecode/templates/forks/fork.mako +++ b/rhodecode/templates/forks/fork.mako @@ -27,7 +27,7 @@ ${self.breadcrumbs()}
- ${h.secure_form(url('repo_fork_create_home',repo_name=c.repo_info.repo_name))} + ${h.secure_form(h.url('repo_fork_create_home',repo_name=c.repo_info.repo_name))}
diff --git a/rhodecode/templates/pullrequests/pullrequest.mako b/rhodecode/templates/pullrequests/pullrequest.mako index 178d4a38..9affe2bc 100644 --- a/rhodecode/templates/pullrequests/pullrequest.mako +++ b/rhodecode/templates/pullrequests/pullrequest.mako @@ -22,7 +22,7 @@ ${self.repo_page_title(c.rhodecode_db_repo)}
- ${h.secure_form(url('pullrequest', repo_name=c.repo_name), method='post', id='pull_request_form')} + ${h.secure_form(h.url('pullrequest', repo_name=c.repo_name), method='post', id='pull_request_form')} ${self.breadcrumbs()} diff --git a/rhodecode/templates/pullrequests/pullrequest_merge_checks.mako b/rhodecode/templates/pullrequests/pullrequest_merge_checks.mako index 325c47e3..f9b9ab53 100644 --- a/rhodecode/templates/pullrequests/pullrequest_merge_checks.mako +++ b/rhodecode/templates/pullrequests/pullrequest_merge_checks.mako @@ -32,7 +32,7 @@
% if c.allowed_to_merge:
- ${h.secure_form(url('pullrequest_merge', repo_name=c.repo_name, pull_request_id=c.pull_request.pull_request_id), id='merge_pull_request_form')} + ${h.secure_form(h.url('pullrequest_merge', repo_name=c.repo_name, pull_request_id=c.pull_request.pull_request_id), id='merge_pull_request_form')} <% merge_disabled = ' disabled' if c.pr_merge_possible is False else '' %> ${_('refresh checks')} diff --git a/rhodecode/templates/pullrequests/pullrequest_show.mako b/rhodecode/templates/pullrequests/pullrequest_show.mako index 0b8b2abe..40dca8ea 100644 --- a/rhodecode/templates/pullrequests/pullrequest_show.mako +++ b/rhodecode/templates/pullrequests/pullrequest_show.mako @@ -32,7 +32,7 @@
@@ -52,7 +52,7 @@ %if c.allowed_to_update:
% if c.allowed_to_delete: - ${h.secure_form(url('pullrequest_delete', repo_name=c.pull_request.target_repo.repo_name, pull_request_id=c.pull_request.pull_request_id),method='delete')} + ${h.secure_form(h.url('pullrequest_delete', repo_name=c.pull_request.target_repo.repo_name, pull_request_id=c.pull_request.pull_request_id),method='delete')} ${h.submit('remove_%s' % c.pull_request.pull_request_id, _('Delete'), class_="btn btn-link btn-danger no-margin",onclick="return confirm('"+_('Confirm to delete this pull request')+"');")} ${h.end_form()}