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")}