Add separate notification category for orders that require approval

This commit is contained in:
Raphael Michel
2018-11-30 15:30:35 +01:00
parent ba15c34ce1
commit 47b7d7b36c
4 changed files with 13 additions and 0 deletions

View File

@@ -112,6 +112,10 @@ def register_default_webhook_events(sender, **kwargs):
'pretix.event.order.placed',
_('New order placed'),
),
ParametrizedOrderWebhookEvent(
'pretix.event.order.placed.required_approval',
_('New order requires approval'),
),
ParametrizedOrderWebhookEvent(
'pretix.event.order.paid',
_('Order marked as paid'),

View File

@@ -193,6 +193,12 @@ def register_default_notification_types(sender, **kwargs):
_('New order placed'),
_('A new order has been placed: {order.code}'),
),
ParametrizedOrderNotificationType(
sender,
'pretix.event.order.placed.require_approval',
_('New order requires approval'),
_('A new order has been placed that requires approval: {order.code}'),
),
ParametrizedOrderNotificationType(
sender,
'pretix.event.order.paid',

View File

@@ -542,6 +542,8 @@ def _create_order(event: Event, email: str, positions: List[CartPosition], now_d
OrderPosition.transform_cart_positions(positions, order)
order.log_action('pretix.event.order.placed')
if order.require_approval:
order.log_action('pretix.event.order.placed.require_approval')
if meta_info:
for msg in meta_info.get('confirm_messages', []):
order.log_action('pretix.event.order.consent', data={'msg': msg})

View File

@@ -165,6 +165,7 @@ def pretixcontrol_logentry_display(sender: Event, logentry: LogEntry, **kwargs):
'pretix.event.order.refunded': _('The order has been refunded.'),
'pretix.event.order.canceled': _('The order has been canceled.'),
'pretix.event.order.placed': _('The order has been created.'),
'pretix.event.order.placed.require_approval': _('The order requires approval before it can continue to be processed.'),
'pretix.event.order.approved': _('The order has been approved.'),
'pretix.event.order.denied': _('The order has been denied.'),
'pretix.event.order.contact.changed': _('The email address has been changed from "{old_email}" '