Skip to content

Commit f9edd1c

Browse files
committed
Fix invalid operation.
1 parent 1280576 commit f9edd1c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

django_mongodb_backend/creation.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@ def _destroy_test_db(self, test_database_name, verbosity):
2222

2323
for collection in self.connection.introspection.table_names():
2424
if not collection.startswith("system."):
25-
db_collection = self.connection.database.get_collection(collection)
26-
for search_indexes in db_collection.list_search_indexes():
27-
db_collection.drop_search_index(search_indexes["name"])
25+
if self.connection.features.supports_atlas_search:
26+
db_collection = self.connection.database.get_collection(collection)
27+
for search_indexes in db_collection.list_search_indexes():
28+
db_collection.drop_search_index(search_indexes["name"])
2829
self.connection.database.drop_collection(collection)
2930

3031
def create_test_db(self, *args, **kwargs):

0 commit comments

Comments
 (0)