Changeset - 9cfc66a665ae
[Not reviewed]
default
0 2 0
Mads Kiilerich - 11 years ago 2014-08-21 23:46:55
madski@unity3d.com
pull requests: rework handling of comments and texts when voting and closing

Close did not leave any records - now it does.

Status changes without comments repeated the status change in text - now it
doesn't repeat itself.
2 files changed with 9 insertions and 13 deletions:
0 comments (0 inline, 0 general)
kallithea/controllers/changeset.py
Show inline comments
 
@@ -349,10 +349,7 @@ class ChangesetController(BaseRepoContro
 
    @jsonify
 
    def comment(self, repo_name, revision):
 
        status = request.POST.get('changeset_status')
 
        text = request.POST.get('text')
 
        if status:
 
            text = text or (_('Status change -> %s')
 
                            % ChangesetStatus.get_status_lbl(status))
 
        text = request.POST.get('text', '').strip() or _('No comments.')
 

	
 
        c.co = comm = ChangesetCommentsModel().create(
 
            text=text,
kallithea/controllers/pullrequests.py
Show inline comments
 
@@ -687,17 +687,16 @@ class PullrequestsController(BaseRepoCon
 
    def comment(self, repo_name, pull_request_id):
 
        pull_request = PullRequest.get_or_404(pull_request_id)
 

	
 
        status = request.POST.get('changeset_status')
 
        text = request.POST.get('text')
 
        close_pr = request.POST.get('save_close')
 

	
 
        status = 0
 
        close_pr = False
 
        allowed_to_change_status = self._get_is_allowed_change_status(pull_request)
 
        if status and allowed_to_change_status:
 
            _def = (_('Status change -> %s')
 
                            % ChangesetStatus.get_status_lbl(status))
 
        if allowed_to_change_status:
 
            status = request.POST.get('changeset_status')
 
            close_pr = request.POST.get('save_close')
 
        text = request.POST.get('text', '').strip() or _('No comments.')
 
            if close_pr:
 
                _def = _('Closing with') + ' ' + _def
 
            text = text or _def
 
            text = _('Closing.') + '\n' + text
 

	
 
        comm = ChangesetCommentsModel().create(
 
            text=text,
 
            repo=c.db_repo.repo_id,
0 comments (0 inline, 0 general)