mirror of
https://github.com/django/django.git
synced 2025-10-29 00:26:07 +00:00
Fixed #26026 -- Fixed isinstance crash comparing EmptyQuerySet to non-QuerySet.
This commit is contained in:
committed by
Tim Graham
parent
b643386668
commit
b5f8c81ce1
@@ -1171,7 +1171,7 @@ class QuerySet(object):
|
||||
|
||||
class InstanceCheckMeta(type):
|
||||
def __instancecheck__(self, instance):
|
||||
return instance.query.is_empty()
|
||||
return isinstance(instance, QuerySet) and instance.query.is_empty()
|
||||
|
||||
|
||||
class EmptyQuerySet(six.with_metaclass(InstanceCheckMeta)):
|
||||
|
||||
Reference in New Issue
Block a user