mirror of
https://github.com/pretix/pretix.git
synced 2026-05-08 15:44:02 +00:00
Simplify behaviour on re-adding cart positions
This commit is contained in:
@@ -120,11 +120,7 @@ class CartAdd(EventViewMixin, CartActionMixin, View):
|
|||||||
messages.error(self.request, msg)
|
messages.error(self.request, msg)
|
||||||
|
|
||||||
def _re_add_position(self, position):
|
def _re_add_position(self, position):
|
||||||
for i, tup in enumerate(self.items):
|
self.items.insert(0, (position.item_id, position.variation_id, 1, position))
|
||||||
if tup[0] == position.item_id and tup[1] == position.variation_id:
|
|
||||||
self.items[i] = (tup[0], tup[1], tup[2] + 1)
|
|
||||||
return self.items
|
|
||||||
self.items.append((position.item_id, position.variation_id, 1, position))
|
|
||||||
|
|
||||||
def _expired_positions(self):
|
def _expired_positions(self):
|
||||||
positions = set()
|
positions = set()
|
||||||
|
|||||||
Reference in New Issue
Block a user