Skip to content

Commit bc981bd

Browse files
committed
Don't use deprecated property for emptiness check
1 parent 23ab63c commit bc981bd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mongoengine/queryset/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ def with_id(self, object_id):
722722
:param object_id: the value for the id of the document to look up
723723
"""
724724
queryset = self.clone()
725-
if not queryset._query_obj.empty:
725+
if bool(queryset._query_obj):
726726
msg = "Cannot use a filter whilst using `with_id`"
727727
raise InvalidQueryError(msg)
728728
return queryset.filter(pk=object_id).first()

0 commit comments

Comments
 (0)