forked from CGM_Public/pretix_original
Fix a ProtectedError in cart handling
FIx PRETIXEU-TR
This commit is contained in:
@@ -371,7 +371,7 @@ class CartManager:
|
|||||||
# could cancel each other out quota-wise). However, we are not taking this performance
|
# could cancel each other out quota-wise). However, we are not taking this performance
|
||||||
# penalty for now as there is currently no outside interface that would allow building
|
# penalty for now as there is currently no outside interface that would allow building
|
||||||
# such a transaction.
|
# such a transaction.
|
||||||
for cp in self.positions.all():
|
for cp in self.positions.filter(addon_to__isnull=True):
|
||||||
self._operations.append(self.RemoveOperation(position=cp))
|
self._operations.append(self.RemoveOperation(position=cp))
|
||||||
|
|
||||||
def set_addons(self, addons):
|
def set_addons(self, addons):
|
||||||
@@ -653,6 +653,7 @@ class CartManager:
|
|||||||
op.position.price = op.price.gross
|
op.position.price = op.price.gross
|
||||||
op.position.save()
|
op.position.save()
|
||||||
elif available_count == 0:
|
elif available_count == 0:
|
||||||
|
op.position.addons.all().delete()
|
||||||
op.position.delete()
|
op.position.delete()
|
||||||
else:
|
else:
|
||||||
raise AssertionError("ExtendOperation cannot affect more than one item")
|
raise AssertionError("ExtendOperation cannot affect more than one item")
|
||||||
|
|||||||
Reference in New Issue
Block a user