mirror of
https://github.com/pretix/pretix.git
synced 2026-05-07 15:34:02 +00:00
Fix problem with modifying orders
This commit is contained in:
@@ -363,6 +363,9 @@ class OrderInvoiceCreate(EventViewMixin, OrderDetailMixin, View):
|
|||||||
class OrderModify(EventViewMixin, OrderDetailMixin, QuestionsViewMixin, TemplateView):
|
class OrderModify(EventViewMixin, OrderDetailMixin, QuestionsViewMixin, TemplateView):
|
||||||
template_name = "pretixpresale/event/order_modify.html"
|
template_name = "pretixpresale/event/order_modify.html"
|
||||||
|
|
||||||
|
def _positions_for_questions(self):
|
||||||
|
return self.positions
|
||||||
|
|
||||||
@cached_property
|
@cached_property
|
||||||
def positions(self):
|
def positions(self):
|
||||||
return list(self.order.positions.order_by(
|
return list(self.order.positions.order_by(
|
||||||
|
|||||||
@@ -7,6 +7,10 @@ from pretix.presale.views import get_cart
|
|||||||
|
|
||||||
|
|
||||||
class QuestionsViewMixin:
|
class QuestionsViewMixin:
|
||||||
|
|
||||||
|
def _positions_for_questions(self):
|
||||||
|
return get_cart(self.request)
|
||||||
|
|
||||||
@cached_property
|
@cached_property
|
||||||
def forms(self):
|
def forms(self):
|
||||||
"""
|
"""
|
||||||
@@ -15,7 +19,7 @@ class QuestionsViewMixin:
|
|||||||
submitted at once.
|
submitted at once.
|
||||||
"""
|
"""
|
||||||
formlist = []
|
formlist = []
|
||||||
for cr in get_cart(self.request):
|
for cr in self._positions_for_questions():
|
||||||
cartpos = cr if isinstance(cr, CartPosition) else None
|
cartpos = cr if isinstance(cr, CartPosition) else None
|
||||||
orderpos = cr if isinstance(cr, OrderPosition) else None
|
orderpos = cr if isinstance(cr, OrderPosition) else None
|
||||||
form = QuestionsForm(event=self.request.event,
|
form = QuestionsForm(event=self.request.event,
|
||||||
|
|||||||
Reference in New Issue
Block a user