You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by jo...@apache.org on 2013/04/04 18:38:10 UTC

[6/9] git commit: [#5673] ticket:299 Fixed retreiving of custom fields' labels

[#5673] ticket:299 Fixed retreiving of custom fields' labels


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/fe015712
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/fe015712
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/fe015712

Branch: refs/heads/master
Commit: fe015712f8036747c9f2cf9b715825612b27df9a
Parents: 3ebc8c1
Author: Aleksey 'LXj' Alekseyev <go...@gmail.com>
Authored: Mon Apr 1 18:05:59 2013 +0300
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Thu Apr 4 08:06:44 2013 +0000

----------------------------------------------------------------------
 .../forgetracker/tests/functional/test_root.py     |    6 +++---
 ForgeTracker/forgetracker/tracker_main.py          |    6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/fe015712/ForgeTracker/forgetracker/tests/functional/test_root.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tests/functional/test_root.py b/ForgeTracker/forgetracker/tests/functional/test_root.py
index fa715a3..b0d9c64 100644
--- a/ForgeTracker/forgetracker/tests/functional/test_root.py
+++ b/ForgeTracker/forgetracker/tests/functional/test_root.py
@@ -621,7 +621,7 @@ class TestFunctionalController(TrackerTestController):
                           params=variable_encode(params))
         kw = {'custom_fields._number':''}
         ticket_view = self.new_ticket(summary='test custom fields', **kw).follow()
-        assert '<strong>number</strong>:  --&gt;' not in ticket_view
+        assert '<strong>Number</strong>:  --&gt;' not in ticket_view
         ticket_view = self.app.post('/bugs/1/update_ticket',params={
             'summary':'zzz',
             'description':'bbb',
@@ -632,7 +632,7 @@ class TestFunctionalController(TrackerTestController):
             'custom_fields._number':'',
             'comment': ''
         }).follow()
-        assert '<strong>number</strong>:  --&gt;' not in ticket_view
+        assert '<strong>Number</strong>:  --&gt;' not in ticket_view
         ticket_view = self.app.post('/bugs/1/update_ticket',params={
             'summary':'zzz',
             'description':'bbb',
@@ -643,7 +643,7 @@ class TestFunctionalController(TrackerTestController):
             'custom_fields._number':'4',
             'comment': ''
         }).follow()
-        assert '<strong>number</strong>:  --&gt;' in ticket_view
+        assert '<strong>Number</strong>:  --&gt;' in ticket_view
 
     def test_milestone_names(self):
         params = {

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/fe015712/ForgeTracker/forgetracker/tracker_main.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tracker_main.py b/ForgeTracker/forgetracker/tracker_main.py
index 24dc780..fc9c2c5 100644
--- a/ForgeTracker/forgetracker/tracker_main.py
+++ b/ForgeTracker/forgetracker/tracker_main.py
@@ -790,7 +790,7 @@ class RootController(BaseController):
                 ticket.custom_fields[k] = v
                 new_value = cf_val(cf)
                 message += get_change_text(
-                    get_label(k),
+                    cf.label,
                     new_value,
                     old_value)
             if message != '':
@@ -1294,9 +1294,9 @@ class TicketController(BaseController):
                     return self.ticket.get_custom_user(cf.name) \
                            if cf.type == 'user' \
                            else self.ticket.custom_fields.get(cf.name)
-                changes[get_label(cf.name)] = cf_val(cf)
+                changes[cf.label] = cf_val(cf)
                 self.ticket.custom_fields[cf.name] = value
-                changes[get_label(cf.name)] = cf_val(cf)
+                changes[cf.label] = cf_val(cf)
         thread = self.ticket.discussion_thread
         tpl_fn = pkg_resources.resource_filename(
             'forgetracker', 'data/ticket_changed_tmpl')