allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [26/27] git commit: [#7657] skip *anonymous whose None id doesn't work as an ObjectId
Date Mon, 29 Sep 2014 16:17:57 GMT
[#7657] skip *anonymous whose None id doesn't work as an ObjectId


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

Branch: refs/heads/db/7657
Commit: a3d64fd15e777cac2533cfa470f482c889ee8115
Parents: 2927ea5
Author: Dave Brondsema <dbrondsema@slashdotmedia.com>
Authored: Fri Sep 26 20:23:35 2014 +0000
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Fri Sep 26 21:57:42 2014 +0000

----------------------------------------------------------------------
 Allura/allura/controllers/site_admin.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/a3d64fd1/Allura/allura/controllers/site_admin.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/site_admin.py b/Allura/allura/controllers/site_admin.py
index 7090343..9f6cc38 100644
--- a/Allura/allura/controllers/site_admin.py
+++ b/Allura/allura/controllers/site_admin.py
@@ -264,7 +264,8 @@ class SiteAdminController(object):
             if match:
                 count = match.hits
                 objects = match.docs
-                ids = [bson.ObjectId(obj['id'].split('#')[1]) for obj in objects]
+                ids = [obj['id'].split('#')[1] for obj in objects]
+                ids = [bson.ObjectId(_id) for _id in ids if _id != 'None']
                 mongo_objects = {}
                 for obj in model.query.find({'_id': {'$in': ids}}):
                     mongo_objects[str(obj._id)] = obj


Mime
View raw message