diff --git a/rhodecode/apps/repository/views/repo_pull_requests.py b/rhodecode/apps/repository/views/repo_pull_requests.py --- a/rhodecode/apps/repository/views/repo_pull_requests.py +++ b/rhodecode/apps/repository/views/repo_pull_requests.py @@ -812,12 +812,16 @@ class RepoPullRequestsView(RepoAppView, Session().commit() h.flash(_('Successfully opened new pull request'), category='success') - except Exception as e: + except Exception: msg = _('Error occurred during creation of this pull request.') log.exception(msg) h.flash(msg, category='error') + + # copy the args back to redirect + org_query = self.request.GET.mixed() raise HTTPFound( - h.route_path('pullrequest_new', repo_name=self.db_repo_name)) + h.route_path('pullrequest_new', repo_name=self.db_repo_name, + _query=org_query)) raise HTTPFound( h.route_path('pullrequest_show', repo_name=target_repo, diff --git a/rhodecode/templates/pullrequests/pullrequest.mako b/rhodecode/templates/pullrequests/pullrequest.mako --- 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(h.route_path('pullrequest_create', repo_name=c.repo_name), id='pull_request_form', method='POST', request=request)} + ${h.secure_form(h.route_path('pullrequest_create', repo_name=c.repo_name, _query=request.GET.mixed()), id='pull_request_form', method='POST', request=request)} ${self.breadcrumbs()}