diff --git a/cloud/routes.py b/cloud/routes.py index f86ce9a..da64c5d 100644 --- a/cloud/routes.py +++ b/cloud/routes.py @@ -278,11 +278,6 @@ def get_random_featured_nodes() -> typing.List[dict]: 'foreignField': '_id', 'as': 'node'}}, {'$unwind': {'path': '$node'}}, - {'$lookup': {"from": "users", - "localField": "node.user", - "foreignField": "_id", - "as": "node.user"}}, - {'$unwind': {'path': "$node.user"}}, {'$match': {'node._deleted': {'$ne': True}}}, {'$project': {'url': True, 'name': True, @@ -296,7 +291,8 @@ def get_random_featured_nodes() -> typing.List[dict]: 'node.properties.duration_seconds': True, 'node.properties.url': True, 'node._created': True, - 'node.user.full_name': True,}}, + } + }, ]) featured_node_documents = [] diff --git a/tests/test_routes.py b/tests/test_routes.py index 5ef86fa..417f62b 100644 --- a/tests/test_routes.py +++ b/tests/test_routes.py @@ -166,4 +166,5 @@ class RandomFeaturedNodeTest(AbstractCloudTest): self.assertTrue(asset.properties.content_type == 'video') self.assertEquals(self.fake_now, asset['_created']) self.assertEquals(str(node_id), asset['_id']) - self.assertEquals(75, asset['properties']['duration_seconds']) \ No newline at end of file + self.assertEquals(75, asset['properties']['duration_seconds']) + self.assertNotIn('user', asset)