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 Wed, 14 Dec 2016 22:05:08 GMT
Repository: allura
Updated Branches:
  refs/heads/db/7839 [created] 1a94a74af


[#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/1a94a74a
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/1a94a74a
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/1a94a74a

Branch: refs/heads/db/7839
Commit: 1a94a74af8eb91e9ab4d5a6a66f6f89ab18e7239
Parents: 7eee12c
Author: Dave Brondsema <dave@brondsema.net>
Authored: Wed Dec 14 16:59:42 2016 -0500
Committer: Dave Brondsema <dave@brondsema.net>
Committed: Wed Dec 14 16:59:42 2016 -0500

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


http://git-wip-us.apache.org/repos/asf/allura/blob/1a94a74a/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