PYTHON-785 - Check Collection's write_concern in GridFS

This commit is contained in:
Bernie Hackett 2014-12-20 14:05:41 -08:00
parent 5fed41b0fb
commit 0c277f6fd2

View File

@ -297,7 +297,7 @@ class GridIn(object):
raise ValueError("cannot write to a closed file")
# With w=0, 'filemd5' might run before the final chunks are written.
if 0 == self._coll.database.connection.write_concern.get('w'):
if not self._coll.acknowledged:
raise InvalidOperation('Cannot write file to GridFS with w=0')
try: