forked from CGM_Public/pretix_original
Move atomic transaction block
This commit is contained in:
@@ -288,7 +288,6 @@ def _check_positions(event: Event, now_dt: datetime, positions: List[CartPositio
|
||||
raise OrderError(err)
|
||||
|
||||
|
||||
@transaction.atomic
|
||||
def _create_order(event: Event, email: str, positions: List[CartPosition], now_dt: datetime,
|
||||
payment_provider: BasePaymentProvider, locale: str=None, address: int=None,
|
||||
meta_info: dict=None):
|
||||
@@ -317,6 +316,7 @@ def _create_order(event: Event, email: str, positions: List[CartPosition], now_d
|
||||
if last_date < expires:
|
||||
expires = last_date
|
||||
|
||||
with transaction.atomic():
|
||||
order = Order.objects.create(
|
||||
status=Order.STATUS_PENDING,
|
||||
event=event,
|
||||
@@ -344,6 +344,7 @@ def _create_order(event: Event, email: str, positions: List[CartPosition], now_d
|
||||
pass
|
||||
|
||||
order.log_action('pretix.event.order.placed')
|
||||
|
||||
order_placed.send(event, order=order)
|
||||
return order
|
||||
|
||||
|
||||
Reference in New Issue
Block a user