Changeset - 579110ca5178
[Not reviewed]
default
0 3 0
Jan Heylen - 11 years ago 2015-05-04 21:07:37
heyleke@gmail.com
changeset/pullrequest controller: refactor some old variable naming

c.co is a bit cryptic, use the full name c.comment
comm sounds like 'communication', use the full name, comment

tested by adding a single comment on a changeset/pullreques
and running:
* the kallithea/tests/functional/test_changeset_comments.py test
3 files changed with 10 insertions and 10 deletions:
0 comments (0 inline, 0 general)
kallithea/controllers/changeset.py
Show inline comments
 
@@ -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')})
 

	
kallithea/controllers/pullrequests.py
Show inline comments
 
@@ -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')})
 

	
kallithea/templates/changeset/changeset_comment_block.html
Show inline comments
 
## 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)}
0 comments (0 inline, 0 general)