allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject allura git commit: [#7839] handle weird data if there's no role.name; refactor
Date Thu, 15 Dec 2016 16:19:36 GMT
Repository: allura
Updated Branches:
  refs/heads/master 00fb5b4b8 -> 8bc96e98d


[#7839] handle weird data if there's no role.name; refactor


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

Branch: refs/heads/master
Commit: 8bc96e98deeb1209542978ae93c56fa136de8ac8
Parents: 00fb5b4
Author: Dave Brondsema <dave@brondsema.net>
Authored: Wed Dec 14 16:59:42 2016 -0500
Committer: Dave Brondsema <dave@brondsema.net>
Committed: Thu Dec 15 11:19:26 2016 -0500

----------------------------------------------------------------------
 Allura/allura/app.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/8bc96e98/Allura/allura/app.py
----------------------------------------------------------------------
diff --git a/Allura/allura/app.py b/Allura/allura/app.py
index 22190e6..ded5c59 100644
--- a/Allura/allura/app.py
+++ b/Allura/allura/app.py
@@ -989,11 +989,14 @@ class DefaultAdminController(BaseController, AdminControllerMixin):
             new_groups = map(get_role, new_group_ids)
             del_groups = map(get_role, del_group_ids)
 
+            def group_names(groups):
+                return ', '.join((role.name or '<Unnamed>') for role in groups if role)
+
             if new_groups or del_groups:
                 model.AuditLog.log('updated "%s" permission: "%s" => "%s" for %s' % (
                     perm,
-                    ', '.join(map(lambda role: role.name, filter(None, groups + del_groups))),
-                    ', '.join(map(lambda role: role.name, filter(None, groups + new_groups))),
+                    group_names(groups + del_groups),
+                    group_names(groups + new_groups),
                     self.app.config.options['mount_point']))
 
             role_ids = map(ObjectId, group_ids + new_group_ids)


Mime
View raw message