# HG changeset patch # User Mads Kiilerich # Date 2014-08-01 20:28:42 # Node ID a1aa34845e9455c61aa0467051a7c0cd0e19d3a8 # Parent f5e3e703b186ca5f9433704f216eead38ee56341 pull requests: don't allow update of closed PRs diff --git a/kallithea/controllers/pullrequests.py b/kallithea/controllers/pullrequests.py --- a/kallithea/controllers/pullrequests.py +++ b/kallithea/controllers/pullrequests.py @@ -466,6 +466,8 @@ class PullrequestsController(BaseRepoCon def copy_update(self, repo_name, pull_request_id): old_pull_request = PullRequest.get_or_404(pull_request_id) assert old_pull_request.other_repo.repo_name == repo_name + if old_pull_request.is_closed(): + raise HTTPForbidden() org_repo = RepoModel()._get_repo(old_pull_request.org_repo.repo_name) org_ref_type, org_ref_name, org_rev = old_pull_request.org_ref.split(':') diff --git a/kallithea/templates/pullrequests/pullrequest_show.html b/kallithea/templates/pullrequests/pullrequest_show.html --- a/kallithea/templates/pullrequests/pullrequest_show.html +++ b/kallithea/templates/pullrequests/pullrequest_show.html @@ -194,7 +194,7 @@ ${self.repo_context_bar('showpullrequest %endif
${c.update_msg_other}
- %if c.available: + %if c.available and not c.pull_request.is_closed():
${h.submit('copy_update',_('Create pull request update'),class_="btn btn-small")}