Changeset - a1aa34845e94
[Not reviewed]
default
0 2 0
Mads Kiilerich - 11 years ago 2014-08-01 20:28:42
madski@unity3d.com
pull requests: don't allow update of closed PRs
2 files changed with 3 insertions and 1 deletions:
0 comments (0 inline, 0 general)
kallithea/controllers/pullrequests.py
Show inline comments
 
@@ -463,12 +463,14 @@ class PullrequestsController(BaseRepoCon
 
    @NotAnonymous()
 
    @HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
 
                                   'repository.admin')
 
    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(':')
 
        updaterev = request.POST.get('updaterev')
 
        if updaterev:
 
            new_org_rev = self._get_ref_rev(org_repo, 'rev', updaterev)
kallithea/templates/pullrequests/pullrequest_show.html
Show inline comments
 
@@ -191,13 +191,13 @@ ${self.repo_context_bar('showpullrequest
 
                  %endfor
 
                </table>
 
              </div>
 
              %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>
 
            %endif
 
          </div>
 
        ${h.end_form()}
0 comments (0 inline, 0 general)