diff --git a/kallithea/controllers/changeset.py b/kallithea/controllers/changeset.py --- a/kallithea/controllers/changeset.py +++ b/kallithea/controllers/changeset.py @@ -351,7 +351,7 @@ class ChangesetController(BaseRepoContro status = request.POST.get('changeset_status') text = request.POST.get('text', '').strip() - c.co = comm = ChangesetCommentsModel().create( + c.comment = comment = ChangesetCommentsModel().create( text=text, repo=c.db_repo.repo_id, user=c.authuser.user_id, @@ -373,7 +373,7 @@ class ChangesetController(BaseRepoContro c.db_repo.repo_id, status, c.authuser.user_id, - comm, + comment, revision=revision, dont_allow_on_closed_pull_request=True ) @@ -397,8 +397,8 @@ class ChangesetController(BaseRepoContro data = { 'target_id': h.safeid(h.safe_unicode(request.POST.get('f_path'))), } - if comm: - data.update(comm.get_dict()) + if comment: + data.update(comment.get_dict()) data.update({'rendered_text': render('changeset/changeset_comment_block.html')}) diff --git a/kallithea/controllers/pullrequests.py b/kallithea/controllers/pullrequests.py --- a/kallithea/controllers/pullrequests.py +++ b/kallithea/controllers/pullrequests.py @@ -700,7 +700,7 @@ class PullrequestsController(BaseRepoCon if close_pr: text = _('Closing.') + '\n' + text - comm = ChangesetCommentsModel().create( + comment = ChangesetCommentsModel().create( text=text, repo=c.db_repo.repo_id, user=c.authuser.user_id, @@ -723,7 +723,7 @@ class PullrequestsController(BaseRepoCon c.db_repo.repo_id, status, c.authuser.user_id, - comm, + comment, pull_request=pull_request_id ) @@ -741,9 +741,9 @@ class PullrequestsController(BaseRepoCon data = { 'target_id': h.safeid(h.safe_unicode(request.POST.get('f_path'))), } - if comm: - c.co = comm - data.update(comm.get_dict()) + if comment: + c.comment = comment + data.update(comment.get_dict()) data.update({'rendered_text': render('changeset/changeset_comment_block.html')}) diff --git a/kallithea/templates/changeset/changeset_comment_block.html b/kallithea/templates/changeset/changeset_comment_block.html --- a/kallithea/templates/changeset/changeset_comment_block.html +++ b/kallithea/templates/changeset/changeset_comment_block.html @@ -1,4 +1,4 @@ ## this is a dummy html file for partial rendering on server and sending ## generated output via ajax after comment submit <%namespace name="comment" file="/changeset/changeset_file_comment.html"/> -${comment.comment_block(c.co)} +${comment.comment_block(c.comment)}