allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject git commit: [#7675] Removed None elements from roles list
Date Sat, 11 Oct 2014 16:58:44 GMT
Repository: allura
Updated Branches:
  refs/heads/master 0c4699ada -> 14b6bcd5c


[#7675] Removed None elements from roles list


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

Branch: refs/heads/master
Commit: 14b6bcd5cfd2bd828265db111c73e50ba990d1f2
Parents: 0c4699a
Author: Alexander Luberg <aluberg@slashdotmedia.com>
Authored: Mon Oct 6 11:05:57 2014 -0700
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Sat Oct 11 16:58:24 2014 +0000

----------------------------------------------------------------------
 Allura/allura/app.py | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/14b6bcd5/Allura/allura/app.py
----------------------------------------------------------------------
diff --git a/Allura/allura/app.py b/Allura/allura/app.py
index 4fad3f4..fff483d 100644
--- a/Allura/allura/app.py
+++ b/Allura/allura/app.py
@@ -837,8 +837,7 @@ class DefaultAdminController(BaseController):
                 if (acl['permission'] == perm) and (str(acl['role_id']) not in group_ids)
and acl['access'] != model.ACE.DENY:
                     del_group_ids.append(str(acl['role_id']))
 
-            get_role = lambda _id: model.ProjectRole.query.get(
-                _id=ObjectId(_id))
+            get_role = lambda _id: model.ProjectRole.query.get(_id=ObjectId(_id))
             groups = map(get_role, group_ids)
             new_groups = map(get_role, new_group_ids)
             del_groups = map(get_role, del_group_ids)
@@ -846,10 +845,8 @@ class DefaultAdminController(BaseController):
             if new_groups or del_groups:
                 model.AuditLog.log('updated "%s" permission: "%s" => "%s" for %s' % (
                     perm,
-                    ', '.join(
-                        map(lambda role: role.name, groups + del_groups)),
-                    ', '.join(
-                        map(lambda role: role.name, groups + new_groups)),
+                    ', '.join(map(lambda role: role.name, filter(None, groups + del_groups))),
+                    ', '.join(map(lambda role: role.name, filter(None, groups + new_groups))),
                     self.app.config.options['mount_point']))
 
             role_ids = map(ObjectId, group_ids + new_group_ids)


Mime
View raw message