# HG changeset patch # User Mads Kiilerich # Date 1408657615 -7200 # Node ID 9cfc66a665aed53cd46bdbad91dba832cf84aef6 # Parent 9fdd5ec8bc118bae7088884a388da3a98e89abb8 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. diff -r 9fdd5ec8bc11 -r 9cfc66a665ae kallithea/controllers/changeset.py --- a/kallithea/controllers/changeset.py Thu Aug 21 23:46:55 2014 +0200 +++ b/kallithea/controllers/changeset.py Thu Aug 21 23:46:55 2014 +0200 @@ -349,10 +349,7 @@ @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, diff -r 9fdd5ec8bc11 -r 9cfc66a665ae kallithea/controllers/pullrequests.py --- a/kallithea/controllers/pullrequests.py Thu Aug 21 23:46:55 2014 +0200 +++ b/kallithea/controllers/pullrequests.py Thu Aug 21 23:46:55 2014 +0200 @@ -687,17 +687,16 @@ 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 close_pr: - _def = _('Closing with') + ' ' + _def - text = text or _def + 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: + text = _('Closing.') + '\n' + text + comm = ChangesetCommentsModel().create( text=text, repo=c.db_repo.repo_id,