Fix owner field usage (#10)
Reviewed-on: #10 Co-authored-by: Madis Mägi <madis.magi@k-space.ee> Co-committed-by: Madis Mägi <madis.magi@k-space.ee>
This commit is contained in:
		| @@ -24,8 +24,8 @@ async def view_doorboy_uids(request): | ||||
|     async for obj in db.member.find({"enabled": True}): | ||||
|         allowed_names.append(obj["_id"]) | ||||
|     allowed_uids = [] | ||||
|     async for obj in db.inventory.find({"token.uid_hash": {"$exists":True}, "inventory.owner_id": {"$exists":True}, "token.enabled": {"$exists":True}}, {"inventory.owner_id": True, "token.uid_hash": True }): | ||||
|         if obj["inventory"].pop("owner_id") in allowed_names: | ||||
|     async for obj in db.inventory.find({"token.uid_hash": {"$exists":True}, "inventory.owner": {"$exists":True}, "token.enabled": {"$exists":True}}, {"inventory.owner": True, "token.uid_hash": True }): | ||||
|         if obj["inventory"].pop("owner").get("foreign_id") in allowed_names: | ||||
|             del obj["_id"] | ||||
|             del obj["inventory"] | ||||
|             allowed_uids.append(obj) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user