changeset 4410:a1aa34845e94

pull requests: don't allow update of closed PRs
author Mads Kiilerich <madski@unity3d.com>
date Fri, 01 Aug 2014 20:28:42 +0200
parents f5e3e703b186
children 47e54cf3047b
files kallithea/controllers/pullrequests.py kallithea/templates/pullrequests/pullrequest_show.html
diffstat 2 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/controllers/pullrequests.py	Fri Aug 01 20:28:42 2014 +0200
+++ b/kallithea/controllers/pullrequests.py	Fri Aug 01 20:28:42 2014 +0200
@@ -466,6 +466,8 @@
     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(':')
--- a/kallithea/templates/pullrequests/pullrequest_show.html	Fri Aug 01 20:28:42 2014 +0200
+++ b/kallithea/templates/pullrequests/pullrequest_show.html	Fri Aug 01 20:28:42 2014 +0200
@@ -194,7 +194,7 @@
               %endif
               <div class="msg-div">${c.update_msg_other}</div>
             </div>
-            %if c.available:
+            %if c.available and not c.pull_request.is_closed():
               <div class="buttons">
                 ${h.submit('copy_update',_('Create pull request update'),class_="btn btn-small")}
               </div>