From 8399d11378dbc77c53b4ee678c4cc965cc1a60a4 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Mar 28 2014 08:31:35 +0000 Subject: Fix the redirection after creating a pull-request Finally we redirect the user to the list of pull-requests of the repo on which the pull-request was made. --- diff --git a/progit/fork.py b/progit/fork.py index 37ae9a4..9227d14 100644 --- a/progit/fork.py +++ b/progit/fork.py @@ -339,8 +339,16 @@ def new_request_pull(username, repo, commitid=None): ) SESSION.commit() flask.flash(message) - return flask.redirect(flask.url_for( - 'view_issues', username=username, repo=repo.name)) + + if not repo.parent.is_fork: + url = flask.url_for( + 'request_pulls', username=None, repo=repo.parent.name) + else: + url = flask.url_for( + 'request_pulls', username=repo.parent.user, + repo=repo.parent.name) + + return flask.redirect(url) except progit.exceptions.ProgitException, err: flask.flash(str(err), 'error') except SQLAlchemyError, err: # pragma: no cover