incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [1/4] git commit: [#7185] Minor refactor for clarity
Date Wed, 19 Feb 2014 19:18:49 GMT
Repository: incubator-allura
Updated Branches:
  refs/heads/cj/7128 09f213800 -> c32547b42


[#7185] Minor refactor for clarity

Signed-off-by: Cory Johns <cjohns@slashdotmedia.com>


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

Branch: refs/heads/cj/7128
Commit: 6bb7fcf4d6e06e40568338de25ae4c86368fe8c6
Parents: 4e6149d
Author: Cory Johns <cjohns@slashdotmedia.com>
Authored: Wed Feb 19 18:43:11 2014 +0000
Committer: Cory Johns <cjohns@slashdotmedia.com>
Committed: Wed Feb 19 18:50:33 2014 +0000

----------------------------------------------------------------------
 Allura/allura/lib/widgets/project_list.py | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/6bb7fcf4/Allura/allura/lib/widgets/project_list.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/widgets/project_list.py b/Allura/allura/lib/widgets/project_list.py
index d89393a..cc2b933 100644
--- a/Allura/allura/lib/widgets/project_list.py
+++ b/Allura/allura/lib/widgets/project_list.py
@@ -19,6 +19,7 @@ import ew as ew_core
 import ew.jinja2_ew as ew
 
 from pylons import tmpl_context as c
+from paste.deploy.converters import asbool
 
 from allura import model as M
 from allura.lib.security import Credentials
@@ -127,13 +128,8 @@ class ProjectList(ew_core.Widget):
         cred.load_user_roles(c.user._id, *[p._id for p in projects])
         cred.load_project_roles(*[p._id for p in projects])
 
-        true_list = ['true', 't', '1', 'yes', 'y']
         for opt in ['show_proj_icon', 'show_download_button', 'show_awards_banner']:
-            if type(response[opt]) == unicode:
-                if response[opt].lower() in true_list:
-                    response[opt] = True
-                else:
-                    response[opt] = False
+            response[opt] = asbool(response[opt])
 
         if response['sitemaps'] is None and response['display_mode'] != 'list':
             response['sitemaps'] = M.Project.menus(projects)


Mime
View raw message