Skip to content

Commit

Permalink
Merge pull request #2633 from arthurio/master
Browse files Browse the repository at this point in the history
Don't use deprecated property for emptiness check
  • Loading branch information
bagerard authored Mar 11, 2022
2 parents dbc31f0 + 669f3ba commit dd17d73
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mongoengine/queryset/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ def with_id(self, object_id):
:param object_id: the value for the id of the document to look up
"""
queryset = self.clone()
if not queryset._query_obj.empty:
if queryset._query_obj:
msg = "Cannot use a filter whilst using `with_id`"
raise InvalidQueryError(msg)
return queryset.filter(pk=object_id).first()
Expand Down

0 comments on commit dd17d73

Please sign in to comment.