Solve cart deletion issues once and for all

This commit is contained in:
Raphael Michel
2019-04-04 09:05:53 +02:00
parent 2810e2a760
commit b931d27486
7 changed files with 13 additions and 1 deletions

View File

@@ -1158,6 +1158,7 @@ class ItemDelete(EventPermissionRequiredMixin, DeleteView):
success_url = self.get_success_url()
o = self.get_object()
if o.allow_delete():
self.get_object().cartposition_set.filter(addon_to__isnull=False).delete()
self.get_object().cartposition_set.all().delete()
self.get_object().log_action('pretix.event.item.deleted', user=self.request.user)
self.get_object().delete()