Allow setting the read concern to None

This commit is contained in:
Agustin Barto 2020-03-17 21:31:05 -03:00
parent af35b25d15
commit 8913a74a86

View File

@ -1227,7 +1227,7 @@ class BaseQuerySet(object):
raise TypeError("%r is not a valid read concern." % (read_concern,)) raise TypeError("%r is not a valid read concern." % (read_concern,))
queryset = self.clone() queryset = self.clone()
queryset._read_concern = ReadConcern(**read_concern) queryset._read_concern = ReadConcern(**read_concern) if read_concern is not None else None
queryset._cursor_obj = None # we need to re-create the cursor object whenever we apply read_concern queryset._cursor_obj = None # we need to re-create the cursor object whenever we apply read_concern
return queryset return queryset