Skip to content

Commit

Permalink
engine/db: Return None in case no objects are found.
Browse files Browse the repository at this point in the history
This helps for consistency in responses and error handling

Signed-off-by: ZorEl212 <[email protected]>
  • Loading branch information
ZorEl212 committed Oct 31, 2024
1 parent d9071a9 commit e0bd27a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion models/engine/mongodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def process_collection(collection):
collection = self.database[cls.get_cls_name()]
process_collection(collection)

return docs
return docs if len(docs) > 0 else None

def new(self, obj):
collection = self.database[obj.cls_name]
Expand Down

0 comments on commit e0bd27a

Please sign in to comment.