Skip to content

Commit

Permalink
carry forward force_policy to the Queryset
Browse files Browse the repository at this point in the history
force_policy feature is currently only available on the model instances.  Enable this feature for SafeDeleteQuerySet as well.
  • Loading branch information
Steve Jones committed Apr 1, 2017
1 parent 21bdcbb commit fb007a2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions safedelete/managers.py
Expand Up @@ -5,11 +5,11 @@

class SafeDeleteQueryset(models.query.QuerySet):

def delete(self):
def delete(self, force_policy=None):
assert self.query.can_filter(), "Cannot use 'limit' or 'offset' with delete."
# TODO: Replace this by bulk update if we can
for obj in self.all():
obj.delete()
obj.delete(force_policy=force_policy)
self._result_cache = None
delete.alters_data = True

Expand Down

0 comments on commit fb007a2

Please sign in to comment.