From 0c277f6fd2864ac42c5dae1c17a78cb9c3473275 Mon Sep 17 00:00:00 2001 From: Bernie Hackett Date: Sat, 20 Dec 2014 14:05:41 -0800 Subject: [PATCH] PYTHON-785 - Check Collection's write_concern in GridFS --- gridfs/grid_file.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gridfs/grid_file.py b/gridfs/grid_file.py index 463213825..2185b3213 100644 --- a/gridfs/grid_file.py +++ b/gridfs/grid_file.py @@ -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: