changeset 5148:579110ca5178

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
author Jan Heylen <heyleke@gmail.com>
date Mon, 04 May 2015 21:07:37 +0200
parents 45725b774525
children 35120990752f
files kallithea/controllers/changeset.py kallithea/controllers/pullrequests.py kallithea/templates/changeset/changeset_comment_block.html
diffstat 3 files changed, 10 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/controllers/changeset.py	Fri May 15 18:07:27 2015 +0200
+++ b/kallithea/controllers/changeset.py	Mon May 04 21:07:37 2015 +0200
@@ -351,7 +351,7 @@
         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 @@
                     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 @@
         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')})
 
--- a/kallithea/controllers/pullrequests.py	Fri May 15 18:07:27 2015 +0200
+++ b/kallithea/controllers/pullrequests.py	Mon May 04 21:07:37 2015 +0200
@@ -700,7 +700,7 @@
         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 @@
                     c.db_repo.repo_id,
                     status,
                     c.authuser.user_id,
-                    comm,
+                    comment,
                     pull_request=pull_request_id
                 )
 
@@ -741,9 +741,9 @@
         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')})
 
--- a/kallithea/templates/changeset/changeset_comment_block.html	Fri May 15 18:07:27 2015 +0200
+++ b/kallithea/templates/changeset/changeset_comment_block.html	Mon May 04 21:07:37 2015 +0200
@@ -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)}