Skip to content

Commit 84b71a8

Browse files
WaVEVtimgraham
authored andcommitted
Edits
1 parent 240e433 commit 84b71a8

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

django_mongodb_backend/features.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -554,15 +554,14 @@ def is_mongodb_6_3(self):
554554
def supports_search_indexes(self):
555555
dummy_collection = "__null"
556556
try:
557-
# Try to execute an search indexes operation over an existing collection.
557+
# Create or get dummy collection.
558558
try:
559559
collection = self.connection.database.create_collection(dummy_collection)
560560
except CollectionInvalid:
561-
# If the collection exists, it will be removed after this operation.
562561
collection = self.connection.get_collection(dummy_collection)
562+
# Check search indexes support (raises if unsupported).
563563
collection.list_search_indexes()
564564
except OperationFailure:
565-
# Operation fails then search indexes isn't supported.
566565
return False
567566
else:
568567
return True

0 commit comments

Comments
 (0)