Skip to content

Commit e08945b

Browse files
committed
Add comment about suppressing EncryptedCollectionError
1 parent 65bd15a commit e08945b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

django_mongodb_backend/schema.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,8 @@ def _create_collection(self, model):
455455
# Use the encrypted connection and auto_encryption_opts to create an encrypted client
456456
encrypted_client = get_encrypted_client(auto_encryption_opts, self.encrypted_connection)
457457

458+
# If the collection exists, `create_encrypted_collection` will raise an
459+
# EncryptedCollectionError.
458460
with contextlib.suppress(EncryptedCollectionError):
459461
encrypted_client.create_encrypted_collection(
460462
self.encrypted_connection[self.connection.database.name],

0 commit comments

Comments
 (0)