diff --git a/src/dsdk/mongo.py b/src/dsdk/mongo.py index 05653ca..bda9555 100644 --- a/src/dsdk/mongo.py +++ b/src/dsdk/mongo.py @@ -106,9 +106,9 @@ def open_batch( yield batch - key, doc = batch.as_update_doc() - with self.open_mongo() as database: - update_one(database.batches, key, doc) + key, doc = batch.as_update_doc() + with self.open_mongo() as database: + update_one(database.batches, key, doc) def store_evidence(self, batch: Batch, *args, **kwargs) -> None: """Store Evidence."""