mirror of
https://github.com/pretix/pretix.git
synced 2026-05-03 14:54:04 +00:00
Log confirm message consent
This commit is contained in:
@@ -510,6 +510,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')
|
||||
for msg in meta_info.get('confirm_messages', []):
|
||||
order.log_action('pretix.event.order.consent', data={'msg': msg})
|
||||
|
||||
order_placed.send(event, order=order)
|
||||
return order
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import json
|
||||
from decimal import Decimal
|
||||
|
||||
import bleach
|
||||
import dateutil.parser
|
||||
import pytz
|
||||
from django.dispatch import receiver
|
||||
@@ -278,6 +279,11 @@ def pretixcontrol_logentry_display(sender: Event, logentry: LogEntry, **kwargs):
|
||||
if logentry.action_type.startswith('pretix.event.tickets.provider.'):
|
||||
return _('The settings of a ticket output provider have been changed.')
|
||||
|
||||
if logentry.action_type == 'pretix.event.order.consent':
|
||||
return _('The user confirmed the following message: "{}"').format(
|
||||
bleach.clean(logentry.parsed_data.get('msg'), tags=[], strip=True)
|
||||
)
|
||||
|
||||
if logentry.action_type == 'pretix.event.checkin':
|
||||
return _display_checkin(sender, logentry)
|
||||
|
||||
|
||||
@@ -578,7 +578,10 @@ class ConfirmStep(CartMixin, AsyncAction, TemplateFlowStep):
|
||||
return redirect(self.get_error_url())
|
||||
|
||||
meta_info = {
|
||||
'contact_form_data': self.cart_session.get('contact_form_data', {})
|
||||
'contact_form_data': self.cart_session.get('contact_form_data', {}),
|
||||
'confirm_messages': [
|
||||
str(m) for m in self.confirm_messages.values()
|
||||
]
|
||||
}
|
||||
for receiver, response in order_meta_from_request.send(sender=request.event, request=request):
|
||||
meta_info.update(response)
|
||||
|
||||
Reference in New Issue
Block a user