mirror of
https://github.com/pretix/pretix.git
synced 2026-05-10 16:04:02 +00:00
Fix Exception when displaying mail_history (PRETIXEU-BB0) (#4934)
* Fix Exception when displaying mail_history Log entries of type pretix.plugins.banktransfer.order.email.invoice had type(invoices) == int instead of list * Update src/pretix/control/views/orders.py Co-authored-by: Richard Schreiber <schreiber@rami.io> --------- Co-authored-by: Raphael Michel <michel@rami.io> Co-authored-by: Richard Schreiber <schreiber@rami.io>
This commit is contained in:
@@ -2491,10 +2491,13 @@ class OrderEmailHistory(EventPermissionRequiredMixin, OrderViewMixin, ListView):
|
|||||||
def get_context_data(self, **kwargs):
|
def get_context_data(self, **kwargs):
|
||||||
ctx = super().get_context_data(**kwargs)
|
ctx = super().get_context_data(**kwargs)
|
||||||
for l in ctx["logs"]:
|
for l in ctx["logs"]:
|
||||||
if l.parsed_data.get("invoices"):
|
invoice_ids = l.parsed_data.get("invoices")
|
||||||
|
if invoice_ids:
|
||||||
|
if type(invoice_ids) is int:
|
||||||
|
invoice_ids = [invoice_ids]
|
||||||
l.parsed_invoices = Invoice.objects.filter(
|
l.parsed_invoices = Invoice.objects.filter(
|
||||||
event=self.request.event,
|
event=self.request.event,
|
||||||
pk__in=l.parsed_data["invoices"],
|
pk__in=invoice_ids,
|
||||||
)
|
)
|
||||||
if l.parsed_data.get("attach_other_files"):
|
if l.parsed_data.get("attach_other_files"):
|
||||||
l.parsed_other_files = [
|
l.parsed_other_files = [
|
||||||
|
|||||||
@@ -410,7 +410,7 @@ class BankTransfer(BasePaymentProvider):
|
|||||||
'message': email_content,
|
'message': email_content,
|
||||||
'position': None,
|
'position': None,
|
||||||
'recipient': email,
|
'recipient': email,
|
||||||
'invoices': invoice.pk,
|
'invoices': [invoice.pk],
|
||||||
'attach_tickets': False,
|
'attach_tickets': False,
|
||||||
'attach_ical': False,
|
'attach_ical': False,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user