Commit d445abec authored by Paul Swartz's avatar Paul Swartz

make bulk deletes go through `delete_model`

I'm not sure this is ideal (might hide some errors?) but it's the easiest way
to use the hook for both kinds of delete.
parent 0452e961
...@@ -394,8 +394,7 @@ class ModelView(BaseModelView): ...@@ -394,8 +394,7 @@ class ModelView(BaseModelView):
all_ids = [ObjectId(pk) for pk in ids] all_ids = [ObjectId(pk) for pk in ids]
for obj in self.get_query().in_bulk(all_ids).values(): for obj in self.get_query().in_bulk(all_ids).values():
obj.delete() count += self.delete_model(obj)
count += 1
flash(ngettext('Model was successfully deleted.', flash(ngettext('Model was successfully deleted.',
'%(count)s models were successfully deleted.', '%(count)s models were successfully deleted.',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment