Changeset - 0dac14c83d9f
[Not reviewed]
default
0 1 0
Thomas De Schampheleire - 7 years ago 2018-11-10 21:29:29
thomas.de_schampheleire@nokia.com
controllers: pullrequests: rename _get_is_allowed_change_status

Rename the oddly named method '_get_is_allowed_change_status' to
'_is_allowed_to_change_status'. Not only does this read more easily, but
also it is more in line with the variable to which the result is assigned to
'allowed_to_change_status'.
1 file changed with 3 insertions and 3 deletions:
0 comments (0 inline, 0 general)
kallithea/controllers/pullrequests.py
Show inline comments
 
@@ -186,7 +186,7 @@ class PullrequestsController(BaseRepoCon
 
                  ]
 
        return [g for g in groups if g[0]], selected
 

	
 
    def _get_is_allowed_change_status(self, pull_request):
 
    def _is_allowed_to_change_status(self, pull_request):
 
        if pull_request.is_closed():
 
            return False
 

	
 
@@ -453,7 +453,7 @@ class PullrequestsController(BaseRepoCon
 
        repo_model = RepoModel()
 
        c.users_array = repo_model.get_users_js()
 
        c.pull_request = PullRequest.get_or_404(pull_request_id)
 
        c.allowed_to_change_status = self._get_is_allowed_change_status(c.pull_request)
 
        c.allowed_to_change_status = self._is_allowed_to_change_status(c.pull_request)
 
        cc_model = ChangesetCommentsModel()
 
        cs_model = ChangesetStatusModel()
 

	
 
@@ -644,7 +644,7 @@ class PullrequestsController(BaseRepoCon
 
            # status votes and closing is only possible in general comments
 
            raise HTTPBadRequest()
 

	
 
        allowed_to_change_status = self._get_is_allowed_change_status(pull_request)
 
        allowed_to_change_status = self._is_allowed_to_change_status(pull_request)
 
        if not allowed_to_change_status:
 
            if status or close_pr:
 
                h.flash(_('No permission to change pull request status'), 'error')
0 comments (0 inline, 0 general)