fix: fix check if a list is empty
This commit is contained in:
+1
-1
@@ -67,7 +67,7 @@ class MongoWorker:
|
|||||||
{"$sample": {"size": amount}}]
|
{"$sample": {"size": amount}}]
|
||||||
raw_items = list(self.game_data.aggregate(pipeline))
|
raw_items = list(self.game_data.aggregate(pipeline))
|
||||||
|
|
||||||
if raw_items:
|
if not raw_items:
|
||||||
validated_items = [Card.model_validate(item) for item in raw_items]
|
validated_items = [Card.model_validate(item) for item in raw_items]
|
||||||
return validated_items
|
return validated_items
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user