From 8e41ca4f0a5ebdec45876ac7b2ea5db1f6c8fb4d Mon Sep 17 00:00:00 2001 From: Marcin Kuzminski Date: Thu, 27 Dec 2018 11:27:40 +0100 Subject: [PATCH] hooks: handle non-ascii characters in hooks new pull-requests open template. --- rhodecode/lib/hooks_base.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/rhodecode/lib/hooks_base.py b/rhodecode/lib/hooks_base.py index fb5c63d8..92d90937 100644 --- a/rhodecode/lib/hooks_base.py +++ b/rhodecode/lib/hooks_base.py @@ -284,17 +284,16 @@ def post_push(extras): output += _http_ret.title if extras.new_refs: - tmpl = \ - extras.server_url + '/' + \ - extras.repository + \ - "/pull-request/new?{ref_type}={ref_name}" + tmpl = extras.server_url + '/' + extras.repository + \ + "/pull-request/new?{ref_type}={ref_name}" + for branch_name in extras.new_refs['branches']: output += 'RhodeCode: open pull request link: {}\n'.format( - tmpl.format(ref_type='branch', ref_name=branch_name)) + tmpl.format(ref_type='branch', ref_name=safe_str(branch_name))) for book_name in extras.new_refs['bookmarks']: output += 'RhodeCode: open pull request link: {}\n'.format( - tmpl.format(ref_type='bookmark', ref_name=book_name)) + tmpl.format(ref_type='bookmark', ref_name=safe_str(book_name))) hook_response = '' if not is_shadow_repo(extras):