[WEB-4796] fix: update MongoDB collection check to use 'is not None' for better clarity #7671

This commit is contained in:
Nikhil
2025-08-29 14:25:46 +05:30
committed by GitHub
parent 4f349807be
commit 489a6e1e94

View File

@@ -67,7 +67,7 @@ def flush_to_mongo_and_delete(
mongo_archival_failed = False
# Try to insert into MongoDB if available
if mongo_collection and mongo_available:
if mongo_collection is not None and mongo_available:
try:
mongo_collection.bulk_write([InsertOne(doc) for doc in buffer])
except BulkWriteError as bwe: