mirror of
https://github.com/pretix/pretix.git
synced 2026-05-06 15:24:02 +00:00
Add "bulk" argument to order_placed signal (#5505)
* datasync: add immediate parameter to enqueue_order * interactive argument for order_placed signal The ``interactive`` argument specifies whether the order was placed interactively, by a customer (as opposed to via a bulk import or the REST API). * use bulk=True instead of interactive=False to mark bulk imports
This commit is contained in:
@@ -221,7 +221,7 @@ def import_orders(event: Event, fileid: str, settings: dict, locale: str, user,
|
||||
|
||||
for o in orders:
|
||||
with language(o.locale, event.settings.region):
|
||||
order_placed.send(event, order=o)
|
||||
order_placed.send(event, order=o, bulk=True)
|
||||
if o.status == Order.STATUS_PAID:
|
||||
order_paid.send(event, order=o)
|
||||
|
||||
|
||||
@@ -1091,7 +1091,7 @@ def _create_order(event: Event, *, email: str, positions: List[CartPosition], no
|
||||
for msg in meta_info.get('confirm_messages', []):
|
||||
order.log_action('pretix.event.order.consent', data={'msg': msg})
|
||||
|
||||
order_placed.send(event, order=order)
|
||||
order_placed.send(event, order=order, bulk=False)
|
||||
return order, payments
|
||||
|
||||
|
||||
|
||||
@@ -665,12 +665,13 @@ As with all event-plugin signals, the ``sender`` keyword argument will contain t
|
||||
|
||||
order_placed = EventPluginSignal()
|
||||
"""
|
||||
Arguments: ``order``
|
||||
Arguments: ``order``, ``bulk``
|
||||
|
||||
This signal is sent out every time an order is placed. The order object is given
|
||||
as the first argument. This signal is *not* sent out if an order is created through
|
||||
splitting an existing order, so you can not expect to see all orders by listening
|
||||
to this signal.
|
||||
as the first argument. The ``bulk`` argument specifies whether the order was placed
|
||||
as part of a bulk action, e.g. an import from a file.
|
||||
This signal is *not* sent out if an order is created through splitting an existing order,
|
||||
so you can not expect to see all orders by listening to this signal.
|
||||
|
||||
As with all event-plugin signals, the ``sender`` keyword argument will contain the event.
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user