Changeset - 6bd62617b99f
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 13 years ago 2012-07-16 23:47:47
marcin@python-works.com
Opening pull request shouldn't be accessible by anonymous users
1 file changed with 3 insertions and 0 deletions:
0 comments (0 inline, 0 general)
rhodecode/controllers/pullrequests.py
Show inline comments
 
@@ -81,12 +81,13 @@ class PullrequestsController(BaseRepoCon
 

	
 
    def show_all(self, repo_name):
 
        c.pull_requests = PullRequestModel().get_all(repo_name)
 
        c.repo_name = repo_name
 
        return render('/pullrequests/pullrequest_show_all.html')
 

	
 
    @NotAnonymous()
 
    def index(self):
 
        org_repo = c.rhodecode_db_repo
 

	
 
        if org_repo.scm_instance.alias != 'hg':
 
            log.error('Review not available for GIT REPOS')
 
            raise HTTPNotFound
 
@@ -278,12 +279,13 @@ class PullrequestsController(BaseRepoCon
 
                                        c.pull_request_reviewers
 
                                     )
 
        c.changeset_statuses = ChangesetStatus.STATUSES
 
        c.target_repo = c.pull_request.org_repo.repo_name
 
        return render('/pullrequests/pullrequest_show.html')
 

	
 
    @NotAnonymous()
 
    @jsonify
 
    def comment(self, repo_name, pull_request_id):
 
        pull_request = PullRequest.get_or_404(pull_request_id)
 
        if pull_request.is_closed():
 
            raise HTTPForbidden()
 

	
 
@@ -334,12 +336,13 @@ class PullrequestsController(BaseRepoCon
 
            data.update(comm.get_dict())
 
            data.update({'rendered_text':
 
                         render('changeset/changeset_comment_block.html')})
 

	
 
        return data
 

	
 
    @NotAnonymous()
 
    @jsonify
 
    def delete_comment(self, repo_name, comment_id):
 
        co = ChangesetComment.get(comment_id)
 
        if co.pull_request.is_closed():
 
            #don't allow deleting comments on closed pull request
 
            raise HTTPForbidden()
0 comments (0 inline, 0 general)