Skip to content

Commit aaee37a

Browse files
committed
Refactor if conditions
1 parent 8ccb7ba commit aaee37a

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

django_mongodb_backend/schema.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -291,10 +291,8 @@ def remove_index(self, model, index):
291291
return
292292
if isinstance(index, SearchIndex | VectorSearchIndex):
293293
self.get_collection(model._meta.db_table).drop_search_index(index.name)
294-
elif isinstance(index, Index):
295-
self.get_collection(model._meta.db_table).drop_index(index.name)
296294
else:
297-
raise ValueError(f"{type(index)} isn't a supported index type")
295+
self.get_collection(model._meta.db_table).drop_index(index.name)
298296

299297
def _remove_composed_index(
300298
self, model, field_names, constraint_kwargs, column_prefix="", parent_model=None

0 commit comments

Comments
 (0)