You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2016/12/14 22:05:08 UTC
allura git commit: [#7839] handle weird data if there's no role.name;
refactor
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 <da...@brondsema.net>
Authored: Wed Dec 14 16:59:42 2016 -0500
Committer: Dave Brondsema <da...@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)