Allow to add a comment when cancelling an order (#2580)

This commit is contained in:
Raphael Michel
2022-04-12 09:53:02 +02:00
committed by GitHub
parent f7c0921f18
commit 3cdf578c14
43 changed files with 130 additions and 10 deletions

View File

@@ -1082,6 +1082,9 @@ Order state operations
will instead stay paid, but all positions will be removed (or marked as canceled) and replaced by the cancellation will instead stay paid, but all positions will be removed (or marked as canceled) and replaced by the cancellation
fee as the only component of the order. fee as the only component of the order.
You can control whether the customer is notified through ``send_email`` (defaults to ``true``).
You can pass a ``comment`` that can be visible to the user if it is used in the email template.
**Example request**: **Example request**:
.. sourcecode:: http .. sourcecode:: http
@@ -1093,6 +1096,7 @@ Order state operations
{ {
"send_email": true, "send_email": true,
"comment": "Event was canceled.",
"cancellation_fee": null "cancellation_fee": null
} }

View File

@@ -345,6 +345,7 @@ class OrderViewSet(viewsets.ModelViewSet):
@action(detail=True, methods=['POST']) @action(detail=True, methods=['POST'])
def mark_canceled(self, request, **kwargs): def mark_canceled(self, request, **kwargs):
send_mail = request.data.get('send_email', True) send_mail = request.data.get('send_email', True)
comment = request.data.get('comment', None)
cancellation_fee = request.data.get('cancellation_fee', None) cancellation_fee = request.data.get('cancellation_fee', None)
if cancellation_fee: if cancellation_fee:
try: try:
@@ -367,6 +368,7 @@ class OrderViewSet(viewsets.ModelViewSet):
device=request.auth if isinstance(request.auth, Device) else None, device=request.auth if isinstance(request.auth, Device) else None,
oauth_application=request.auth.application if isinstance(request.auth, OAuthAccessToken) else None, oauth_application=request.auth.application if isinstance(request.auth, OAuthAccessToken) else None,
send_mail=send_mail, send_mail=send_mail,
email_comment=comment,
cancellation_fee=cancellation_fee cancellation_fee=cancellation_fee
) )
except OrderError as e: except OrderError as e:

View File

@@ -384,7 +384,7 @@ def deny_order(order, comment='', user=None, send_mail: bool=True, auth=None):
def _cancel_order(order, user=None, send_mail: bool=True, api_token=None, device=None, oauth_application=None, def _cancel_order(order, user=None, send_mail: bool=True, api_token=None, device=None, oauth_application=None,
cancellation_fee=None, keep_fees=None, cancel_invoice=True): cancellation_fee=None, keep_fees=None, cancel_invoice=True, comment=None):
""" """
Mark this order as canceled Mark this order as canceled
:param order: The order to change :param order: The order to change
@@ -481,7 +481,7 @@ def _cancel_order(order, user=None, send_mail: bool=True, api_token=None, device
Voucher.objects.filter(pk=position.voucher.pk).update(redeemed=Greatest(0, F('redeemed') - 1)) Voucher.objects.filter(pk=position.voucher.pk).update(redeemed=Greatest(0, F('redeemed') - 1))
order.log_action('pretix.event.order.canceled', user=user, auth=api_token or oauth_application or device, order.log_action('pretix.event.order.canceled', user=user, auth=api_token or oauth_application or device,
data={'cancellation_fee': cancellation_fee}) data={'cancellation_fee': cancellation_fee, 'comment': comment})
order.cancellation_requests.all().delete() order.cancellation_requests.all().delete()
order.create_transactions() order.create_transactions()
@@ -489,7 +489,7 @@ def _cancel_order(order, user=None, send_mail: bool=True, api_token=None, device
if send_mail: if send_mail:
email_template = order.event.settings.mail_text_order_canceled email_template = order.event.settings.mail_text_order_canceled
with language(order.locale, order.event.settings.region): with language(order.locale, order.event.settings.region):
email_context = get_email_context(event=order.event, order=order) email_context = get_email_context(event=order.event, order=order, comment=comment or "")
email_subject = _('Order canceled: %(code)s') % {'code': order.code} email_subject = _('Order canceled: %(code)s') % {'code': order.code}
try: try:
order.send_mail( order.send_mail(
@@ -2506,15 +2506,15 @@ def _try_auto_refund(order, auto_refund=True, manual_refund=False, allow_partial
@app.task(base=ProfiledTask, bind=True, max_retries=5, default_retry_delay=1, throws=(OrderError,)) @app.task(base=ProfiledTask, bind=True, max_retries=5, default_retry_delay=1, throws=(OrderError,))
@scopes_disabled() @scopes_disabled()
def cancel_order(self, order: int, user: int=None, send_mail: bool=True, api_token=None, oauth_application=None, def cancel_order(self, order: int, user: int=None, send_mail: bool=True, api_token=None, oauth_application=None,
device=None, cancellation_fee=None, try_auto_refund=False, refund_as_giftcard=False, comment=None, device=None, cancellation_fee=None, try_auto_refund=False, refund_as_giftcard=False,
cancel_invoice=True): email_comment=None, refund_comment=None, cancel_invoice=True):
try: try:
try: try:
ret = _cancel_order(order, user, send_mail, api_token, device, oauth_application, ret = _cancel_order(order, user, send_mail, api_token, device, oauth_application,
cancellation_fee, cancel_invoice=cancel_invoice) cancellation_fee, cancel_invoice=cancel_invoice, comment=email_comment)
if try_auto_refund: if try_auto_refund:
_try_auto_refund(order, refund_as_giftcard=refund_as_giftcard, _try_auto_refund(order, refund_as_giftcard=refund_as_giftcard,
comment=comment) comment=refund_comment)
return ret return ret
except LockTimeoutException: except LockTimeoutException:
self.retry() self.retry()

View File

@@ -1914,6 +1914,8 @@ Your {event} team"""))
your order {code} for {event} has been canceled. your order {code} for {event} has been canceled.
{comment}
You can view the details of your order at You can view the details of your order at
{url} {url}

View File

@@ -1075,7 +1075,7 @@ class MailSettingsForm(SettingsForm):
'mail_text_order_free': ['event', 'order'], 'mail_text_order_free': ['event', 'order'],
'mail_text_order_free_attendee': ['event', 'order', 'position'], 'mail_text_order_free_attendee': ['event', 'order', 'position'],
'mail_text_order_changed': ['event', 'order'], 'mail_text_order_changed': ['event', 'order'],
'mail_text_order_canceled': ['event', 'order'], 'mail_text_order_canceled': ['event', 'order', 'comment'],
'mail_text_order_expire_warning': ['event', 'order'], 'mail_text_order_expire_warning': ['event', 'order'],
'mail_text_order_custom_mail': ['event', 'order'], 'mail_text_order_custom_mail': ['event', 'order'],
'mail_text_download_reminder': ['event', 'order'], 'mail_text_download_reminder': ['event', 'order'],

View File

@@ -167,6 +167,12 @@ class CancelForm(ForceQuotaConfirmationForm):
initial=True, initial=True,
required=False required=False
) )
comment = forms.CharField(
label=_('Comment (will be sent to the user)'),
help_text=_('Will be included in the notification email when the respective placeholder is present in the '
'configured email text.'),
required=False,
)
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs) super().__init__(*args, **kwargs)

View File

@@ -341,7 +341,6 @@ def pretixcontrol_logentry_display(sender: Event, logentry: LogEntry, **kwargs):
'pretix.event.order.paid': _('The order has been marked as paid.'), 'pretix.event.order.paid': _('The order has been marked as paid.'),
'pretix.event.order.cancellationrequest.deleted': _('The cancellation request has been deleted.'), 'pretix.event.order.cancellationrequest.deleted': _('The cancellation request has been deleted.'),
'pretix.event.order.refunded': _('The order has been refunded.'), 'pretix.event.order.refunded': _('The order has been refunded.'),
'pretix.event.order.canceled': _('The order has been canceled.'),
'pretix.event.order.reactivated': _('The order has been reactivated.'), 'pretix.event.order.reactivated': _('The order has been reactivated.'),
'pretix.event.order.deleted': _('The test mode order {code} has been deleted.'), 'pretix.event.order.deleted': _('The test mode order {code} has been deleted.'),
'pretix.event.order.placed': _('The order has been created.'), 'pretix.event.order.placed': _('The order has been created.'),
@@ -532,6 +531,13 @@ def pretixcontrol_logentry_display(sender: Event, logentry: LogEntry, **kwargs):
bleach.clean(logentry.parsed_data.get('msg'), tags=[], strip=True) bleach.clean(logentry.parsed_data.get('msg'), tags=[], strip=True)
) )
if logentry.action_type == 'pretix.event.order.canceled':
comment = logentry.parsed_data.get('comment')
if comment:
return _('The order has been canceled (comment: "{}").').format(comment)
else:
return _('The order has been canceled.')
if logentry.action_type in ('pretix.control.views.checkin.reverted', 'pretix.event.checkin.reverted'): if logentry.action_type in ('pretix.control.views.checkin.reverted', 'pretix.event.checkin.reverted'):
if 'list' in data: if 'list' in data:
try: try:

View File

@@ -35,6 +35,7 @@
{% bootstrap_field form.cancellation_fee layout='' %} {% bootstrap_field form.cancellation_fee layout='' %}
{% endif %} {% endif %}
{% bootstrap_field form.send_email layout='' %} {% bootstrap_field form.send_email layout='' %}
{% bootstrap_field form.comment layout='' %}
{% if form.cancel_invoice %} {% if form.cancel_invoice %}
{% bootstrap_field form.cancel_invoice layout='' %} {% bootstrap_field form.cancel_invoice layout='' %}
{% endif %} {% endif %}

View File

@@ -1266,6 +1266,7 @@ class OrderTransition(OrderView):
elif self.order.cancel_allowed() and to == 'c' and self.mark_canceled_form.is_valid(): elif self.order.cancel_allowed() and to == 'c' and self.mark_canceled_form.is_valid():
try: try:
cancel_order(self.order.pk, user=self.request.user, cancel_order(self.order.pk, user=self.request.user,
email_comment=self.mark_canceled_form.cleaned_data['comment'],
send_mail=self.mark_canceled_form.cleaned_data['send_email'], send_mail=self.mark_canceled_form.cleaned_data['send_email'],
cancel_invoice=self.mark_canceled_form.cleaned_data.get('cancel_invoice', True), cancel_invoice=self.mark_canceled_form.cleaned_data.get('cancel_invoice', True),
cancellation_fee=self.mark_canceled_form.cleaned_data.get('cancellation_fee')) cancellation_fee=self.mark_canceled_form.cleaned_data.get('cancellation_fee'))

View File

@@ -8106,6 +8106,8 @@ msgid ""
"\n" "\n"
"your order {code} for {event} has been canceled.\n" "your order {code} for {event} has been canceled.\n"
"\n" "\n"
"{comment}\n"
"\n"
"You can view the details of your order at\n" "You can view the details of your order at\n"
"{url}\n" "{url}\n"
"\n" "\n"
@@ -8116,6 +8118,8 @@ msgstr ""
"\n" "\n"
"تم إلغاء طلبك {code} الخاص ب {event}.\n" "تم إلغاء طلبك {code} الخاص ب {event}.\n"
"\n" "\n"
"{comment}\n"
"\n"
"يمكنك عرض تفاصيل طلبك من خلال:\n" "يمكنك عرض تفاصيل طلبك من خلال:\n"
"{url}\n" "{url}\n"
"\n" "\n"

View File

@@ -8340,6 +8340,8 @@ msgid ""
"\n" "\n"
"your order {code} for {event} has been canceled.\n" "your order {code} for {event} has been canceled.\n"
"\n" "\n"
"{comment}\n"
"\n"
"You can view the details of your order at\n" "You can view the details of your order at\n"
"{url}\n" "{url}\n"
"\n" "\n"
@@ -8350,6 +8352,8 @@ msgstr ""
"\n" "\n"
"s'ha cancel·lat la vostra comanda {code} per {event}.\n" "s'ha cancel·lat la vostra comanda {code} per {event}.\n"
"\n" "\n"
"{comment}\n"
"\n"
"Podeu veure els detalls de la vostra comanda a\n" "Podeu veure els detalls de la vostra comanda a\n"
"{url}\n" "{url}\n"
"\n" "\n"

View File

@@ -7501,6 +7501,8 @@ msgid ""
"\n" "\n"
"your order {code} for {event} has been canceled.\n" "your order {code} for {event} has been canceled.\n"
"\n" "\n"
"{comment}\n"
"\n"
"You can view the details of your order at\n" "You can view the details of your order at\n"
"{url}\n" "{url}\n"
"\n" "\n"

View File

@@ -7976,6 +7976,8 @@ msgid ""
"\n" "\n"
"your order {code} for {event} has been canceled.\n" "your order {code} for {event} has been canceled.\n"
"\n" "\n"
"{comment}\n"
"\n"
"You can view the details of your order at\n" "You can view the details of your order at\n"
"{url}\n" "{url}\n"
"\n" "\n"
@@ -7986,6 +7988,8 @@ msgstr ""
"\n" "\n"
"Din bestilling {code} til {event} er blevet annulleret.\n" "Din bestilling {code} til {event} er blevet annulleret.\n"
"\n" "\n"
"{comment}\n"
"\n"
"Du kan se detaljerne for din bestilling på\n" "Du kan se detaljerne for din bestilling på\n"
"{url}\n" "{url}\n"
"\n" "\n"

View File

@@ -8303,6 +8303,8 @@ msgid ""
"\n" "\n"
"your order {code} for {event} has been canceled.\n" "your order {code} for {event} has been canceled.\n"
"\n" "\n"
"{comment}\n"
"\n"
"You can view the details of your order at\n" "You can view the details of your order at\n"
"{url}\n" "{url}\n"
"\n" "\n"
@@ -8313,6 +8315,8 @@ msgstr ""
"\n" "\n"
"Ihre Bestellung {code} für {event} wurde storniert.\n" "Ihre Bestellung {code} für {event} wurde storniert.\n"
"\n" "\n"
"{comment}\n"
"\n"
"Sie können Ihre Bestellung unter folgender Adresse einsehen:\n" "Sie können Ihre Bestellung unter folgender Adresse einsehen:\n"
"{url}\n" "{url}\n"
"\n" "\n"

View File

@@ -8291,6 +8291,8 @@ msgid ""
"\n" "\n"
"your order {code} for {event} has been canceled.\n" "your order {code} for {event} has been canceled.\n"
"\n" "\n"
"{comment}\n"
"\n"
"You can view the details of your order at\n" "You can view the details of your order at\n"
"{url}\n" "{url}\n"
"\n" "\n"
@@ -8301,6 +8303,8 @@ msgstr ""
"\n" "\n"
"deine Bestellung {code} für {event} wurde storniert.\n" "deine Bestellung {code} für {event} wurde storniert.\n"
"\n" "\n"
"{comment}\n"
"\n"
"Du kannst deine Bestellung unter folgender Adresse einsehen:\n" "Du kannst deine Bestellung unter folgender Adresse einsehen:\n"
"{url}\n" "{url}\n"
"\n" "\n"

View File

@@ -8697,6 +8697,8 @@ msgid ""
"\n" "\n"
"your order {code} for {event} has been canceled.\n" "your order {code} for {event} has been canceled.\n"
"\n" "\n"
"{comment}\n"
"\n"
"You can view the details of your order at\n" "You can view the details of your order at\n"
"{url}\n" "{url}\n"
"\n" "\n"
@@ -8707,6 +8709,8 @@ msgstr ""
"\n" "\n"
"η παραγγελία σας {code} για {event} έχει ακυρωθεί.\n" "η παραγγελία σας {code} για {event} έχει ακυρωθεί.\n"
"\n" "\n"
"{comment}\n"
"\n"
"Μπορείτε να δείτε τις λεπτομέρειες της παραγγελίας σας στο\n" "Μπορείτε να δείτε τις λεπτομέρειες της παραγγελίας σας στο\n"
"{url}\n" "{url}\n"
"\n" "\n"

View File

@@ -8554,6 +8554,8 @@ msgid ""
"\n" "\n"
"your order {code} for {event} has been canceled.\n" "your order {code} for {event} has been canceled.\n"
"\n" "\n"
"{comment}\n"
"\n"
"You can view the details of your order at\n" "You can view the details of your order at\n"
"{url}\n" "{url}\n"
"\n" "\n"
@@ -8564,6 +8566,8 @@ msgstr ""
"\n" "\n"
"su pedido {code} para {event} ha sido cancelado. \n" "su pedido {code} para {event} ha sido cancelado. \n"
"\n" "\n"
"{comment}\n"
"\n"
"Puede ver los detalles de su pedido en\n" "Puede ver los detalles de su pedido en\n"
"{url}. \n" "{url}. \n"
"\n" "\n"

View File

@@ -7392,6 +7392,8 @@ msgid ""
"\n" "\n"
"your order {code} for {event} has been canceled.\n" "your order {code} for {event} has been canceled.\n"
"\n" "\n"
"{comment}\n"
"\n"
"You can view the details of your order at\n" "You can view the details of your order at\n"
"{url}\n" "{url}\n"
"\n" "\n"

View File

@@ -8798,6 +8798,8 @@ msgid ""
"\n" "\n"
"your order {code} for {event} has been canceled.\n" "your order {code} for {event} has been canceled.\n"
"\n" "\n"
"{comment}\n"
"\n"
"You can view the details of your order at\n" "You can view the details of your order at\n"
"{url}\n" "{url}\n"
"\n" "\n"
@@ -8808,6 +8810,8 @@ msgstr ""
"\n" "\n"
"votre commande {code} pour {event} a été annulée.\n" "votre commande {code} pour {event} a été annulée.\n"
"\n" "\n"
"{comment}\n"
"\n"
"Vous pouvez consulter les détails de votre commande à l'adresse suivante\n" "Vous pouvez consulter les détails de votre commande à l'adresse suivante\n"
"{url}\n" "{url}\n"
"\n" "\n"

View File

@@ -8753,6 +8753,8 @@ msgid ""
"\n" "\n"
"your order {code} for {event} has been canceled.\n" "your order {code} for {event} has been canceled.\n"
"\n" "\n"
"{comment}\n"
"\n"
"You can view the details of your order at\n" "You can view the details of your order at\n"
"{url}\n" "{url}\n"
"\n" "\n"
@@ -8763,6 +8765,8 @@ msgstr ""
"\n" "\n"
"su pedido {code} para {event} ha sido cancelado. \n" "su pedido {code} para {event} ha sido cancelado. \n"
"\n" "\n"
"{comment}\n"
"\n"
"Puede ver los detalles de su pedido en\n" "Puede ver los detalles de su pedido en\n"
"{url}. \n" "{url}. \n"
"\n" "\n"

View File

@@ -7341,6 +7341,8 @@ msgid ""
"\n" "\n"
"your order {code} for {event} has been canceled.\n" "your order {code} for {event} has been canceled.\n"
"\n" "\n"
"{comment}\n"
"\n"
"You can view the details of your order at\n" "You can view the details of your order at\n"
"{url}\n" "{url}\n"
"\n" "\n"

View File

@@ -7435,6 +7435,8 @@ msgid ""
"\n" "\n"
"your order {code} for {event} has been canceled.\n" "your order {code} for {event} has been canceled.\n"
"\n" "\n"
"{comment}\n"
"\n"
"You can view the details of your order at\n" "You can view the details of your order at\n"
"{url}\n" "{url}\n"
"\n" "\n"

View File

@@ -7673,6 +7673,8 @@ msgid ""
"\n" "\n"
"your order {code} for {event} has been canceled.\n" "your order {code} for {event} has been canceled.\n"
"\n" "\n"
"{comment}\n"
"\n"
"You can view the details of your order at\n" "You can view the details of your order at\n"
"{url}\n" "{url}\n"
"\n" "\n"
@@ -7683,6 +7685,8 @@ msgstr ""
"\n" "\n"
"il tuo ordine {code} per {event} è stato cancellato.\n" "il tuo ordine {code} per {event} è stato cancellato.\n"
"\n" "\n"
"{comment}\n"
"\n"
"Puoi vedere i dettagli del tuo ordine qui:\n" "Puoi vedere i dettagli del tuo ordine qui:\n"
"{url}\n" "{url}\n"
"\n" "\n"

View File

@@ -7361,6 +7361,8 @@ msgid ""
"\n" "\n"
"your order {code} for {event} has been canceled.\n" "your order {code} for {event} has been canceled.\n"
"\n" "\n"
"{comment}\n"
"\n"
"You can view the details of your order at\n" "You can view the details of your order at\n"
"{url}\n" "{url}\n"
"\n" "\n"

View File

@@ -7698,6 +7698,8 @@ msgid ""
"\n" "\n"
"your order {code} for {event} has been canceled.\n" "your order {code} for {event} has been canceled.\n"
"\n" "\n"
"{comment}\n"
"\n"
"You can view the details of your order at\n" "You can view the details of your order at\n"
"{url}\n" "{url}\n"
"\n" "\n"

View File

@@ -7390,6 +7390,8 @@ msgid ""
"\n" "\n"
"your order {code} for {event} has been canceled.\n" "your order {code} for {event} has been canceled.\n"
"\n" "\n"
"{comment}\n"
"\n"
"You can view the details of your order at\n" "You can view the details of your order at\n"
"{url}\n" "{url}\n"
"\n" "\n"

View File

@@ -8302,6 +8302,8 @@ msgid ""
"\n" "\n"
"your order {code} for {event} has been canceled.\n" "your order {code} for {event} has been canceled.\n"
"\n" "\n"
"{comment}\n"
"\n"
"You can view the details of your order at\n" "You can view the details of your order at\n"
"{url}\n" "{url}\n"
"\n" "\n"
@@ -8312,6 +8314,8 @@ msgstr ""
"\n" "\n"
"Uw bestelling {code} voor {event} is geannuleerd.\n" "Uw bestelling {code} voor {event} is geannuleerd.\n"
"\n" "\n"
"{comment}\n"
"\n"
"U kunt de gegevens van uw bestelling bekijken op\n" "U kunt de gegevens van uw bestelling bekijken op\n"
"{url}\n" "{url}\n"
"\n" "\n"

View File

@@ -7339,6 +7339,8 @@ msgid ""
"\n" "\n"
"your order {code} for {event} has been canceled.\n" "your order {code} for {event} has been canceled.\n"
"\n" "\n"
"{comment}\n"
"\n"
"You can view the details of your order at\n" "You can view the details of your order at\n"
"{url}\n" "{url}\n"
"\n" "\n"

View File

@@ -8323,6 +8323,8 @@ msgid ""
"\n" "\n"
"your order {code} for {event} has been canceled.\n" "your order {code} for {event} has been canceled.\n"
"\n" "\n"
"{comment}\n"
"\n"
"You can view the details of your order at\n" "You can view the details of your order at\n"
"{url}\n" "{url}\n"
"\n" "\n"
@@ -8333,6 +8335,8 @@ msgstr ""
"\n" "\n"
"Je bestelling {code} voor {event} is geannuleerd.\n" "Je bestelling {code} voor {event} is geannuleerd.\n"
"\n" "\n"
"{comment}\n"
"\n"
"Je kan de gegevens van je bestelling bekijken op {url}\n" "Je kan de gegevens van je bestelling bekijken op {url}\n"
"\n" "\n"
"Met vriendelijke groeten,\n" "Met vriendelijke groeten,\n"

View File

@@ -7902,6 +7902,8 @@ msgid ""
"\n" "\n"
"your order {code} for {event} has been canceled.\n" "your order {code} for {event} has been canceled.\n"
"\n" "\n"
"{comment}\n"
"\n"
"You can view the details of your order at\n" "You can view the details of your order at\n"
"{url}\n" "{url}\n"
"\n" "\n"

View File

@@ -7340,6 +7340,8 @@ msgid ""
"\n" "\n"
"your order {code} for {event} has been canceled.\n" "your order {code} for {event} has been canceled.\n"
"\n" "\n"
"{comment}\n"
"\n"
"You can view the details of your order at\n" "You can view the details of your order at\n"
"{url}\n" "{url}\n"
"\n" "\n"

View File

@@ -7380,6 +7380,8 @@ msgid ""
"\n" "\n"
"your order {code} for {event} has been canceled.\n" "your order {code} for {event} has been canceled.\n"
"\n" "\n"
"{comment}\n"
"\n"
"You can view the details of your order at\n" "You can view the details of your order at\n"
"{url}\n" "{url}\n"
"\n" "\n"

View File

@@ -8011,6 +8011,8 @@ msgid ""
"\n" "\n"
"your order {code} for {event} has been canceled.\n" "your order {code} for {event} has been canceled.\n"
"\n" "\n"
"{comment}\n"
"\n"
"You can view the details of your order at\n" "You can view the details of your order at\n"
"{url}\n" "{url}\n"
"\n" "\n"

View File

@@ -8383,6 +8383,8 @@ msgid ""
"\n" "\n"
"your order {code} for {event} has been canceled.\n" "your order {code} for {event} has been canceled.\n"
"\n" "\n"
"{comment}\n"
"\n"
"You can view the details of your order at\n" "You can view the details of your order at\n"
"{url}\n" "{url}\n"
"\n" "\n"
@@ -8393,6 +8395,8 @@ msgstr ""
"\n" "\n"
"a sua encomenda {code} para {event} foi cancelada.\n" "a sua encomenda {code} para {event} foi cancelada.\n"
"\n" "\n"
"{comment}\n"
"\n"
"Pode ver os detalhes da sua encomenda em\n" "Pode ver os detalhes da sua encomenda em\n"
"{url}\n" "{url}\n"
"\n" "\n"

View File

@@ -7342,6 +7342,8 @@ msgid ""
"\n" "\n"
"your order {code} for {event} has been canceled.\n" "your order {code} for {event} has been canceled.\n"
"\n" "\n"
"{comment}\n"
"\n"
"You can view the details of your order at\n" "You can view the details of your order at\n"
"{url}\n" "{url}\n"
"\n" "\n"

View File

@@ -8076,6 +8076,8 @@ msgid ""
"\n" "\n"
"your order {code} for {event} has been canceled.\n" "your order {code} for {event} has been canceled.\n"
"\n" "\n"
"{comment}\n"
"\n"
"You can view the details of your order at\n" "You can view the details of your order at\n"
"{url}\n" "{url}\n"
"\n" "\n"

View File

@@ -7346,6 +7346,8 @@ msgid ""
"\n" "\n"
"your order {code} for {event} has been canceled.\n" "your order {code} for {event} has been canceled.\n"
"\n" "\n"
"{comment}\n"
"\n"
"You can view the details of your order at\n" "You can view the details of your order at\n"
"{url}\n" "{url}\n"
"\n" "\n"

View File

@@ -7997,6 +7997,8 @@ msgid ""
"\n" "\n"
"your order {code} for {event} has been canceled.\n" "your order {code} for {event} has been canceled.\n"
"\n" "\n"
"{comment}\n"
"\n"
"You can view the details of your order at\n" "You can view the details of your order at\n"
"{url}\n" "{url}\n"
"\n" "\n"

View File

@@ -7949,6 +7949,8 @@ msgid ""
"\n" "\n"
"your order {code} for {event} has been canceled.\n" "your order {code} for {event} has been canceled.\n"
"\n" "\n"
"{comment}\n"
"\n"
"You can view the details of your order at\n" "You can view the details of your order at\n"
"{url}\n" "{url}\n"
"\n" "\n"
@@ -7959,6 +7961,8 @@ msgstr ""
"\n" "\n"
"din beställning {code} för {event} har annullerats.\n" "din beställning {code} för {event} har annullerats.\n"
"\n" "\n"
"{comment}\n"
"\n"
"Du kan se detaljerna för din beställning på\n" "Du kan se detaljerna för din beställning på\n"
"{url}\n" "{url}\n"
"\n" "\n"

View File

@@ -8773,6 +8773,8 @@ msgid ""
"\n" "\n"
"your order {code} for {event} has been canceled.\n" "your order {code} for {event} has been canceled.\n"
"\n" "\n"
"{comment}\n"
"\n"
"You can view the details of your order at\n" "You can view the details of your order at\n"
"{url}\n" "{url}\n"
"\n" "\n"
@@ -8783,6 +8785,8 @@ msgstr ""
"\n" "\n"
"{event} için {code} sipraşiniz iptal edilmiştir.\n" "{event} için {code} sipraşiniz iptal edilmiştir.\n"
"\n" "\n"
"{comment}\n"
"\n"
"Sipraşinizinin detaylarını bu adresten inceleyebilirsiniz\n" "Sipraşinizinin detaylarını bu adresten inceleyebilirsiniz\n"
"{url}\n" "{url}\n"
"\n" "\n"

View File

@@ -7340,6 +7340,8 @@ msgid ""
"\n" "\n"
"your order {code} for {event} has been canceled.\n" "your order {code} for {event} has been canceled.\n"
"\n" "\n"
"{comment}\n"
"\n"
"You can view the details of your order at\n" "You can view the details of your order at\n"
"{url}\n" "{url}\n"
"\n" "\n"

View File

@@ -8150,6 +8150,8 @@ msgid ""
"\n" "\n"
"your order {code} for {event} has been canceled.\n" "your order {code} for {event} has been canceled.\n"
"\n" "\n"
"{comment}\n"
"\n"
"You can view the details of your order at\n" "You can view the details of your order at\n"
"{url}\n" "{url}\n"
"\n" "\n"
@@ -8160,6 +8162,8 @@ msgstr ""
"\n" "\n"
"您{event}的订单{code}已被取消。\n" "您{event}的订单{code}已被取消。\n"
"\n" "\n"
"{comment}\n"
"\n"
"您可以在{url}查看订单的详细信息\n" "您可以在{url}查看订单的详细信息\n"
"\n" "\n"
"致敬,\n" "致敬,\n"

View File

@@ -953,7 +953,7 @@ class OrderCancelDo(EventViewMixin, OrderDetailMixin, AsyncAction, View):
else: else:
comment = gettext('Canceled by customer') comment = gettext('Canceled by customer')
return self.do(self.order.pk, cancellation_fee=fee, try_auto_refund=auto_refund, refund_as_giftcard=giftcard, return self.do(self.order.pk, cancellation_fee=fee, try_auto_refund=auto_refund, refund_as_giftcard=giftcard,
comment=comment) refund_comment=comment)
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
ctx = super().get_context_data(**kwargs) ctx = super().get_context_data(**kwargs)