From 740b6276c1b8a26a6504cfca3764235930d4c6fb Mon Sep 17 00:00:00 2001 From: Thomas Steen Rasmussen Date: Mon, 30 May 2016 20:57:15 +0200 Subject: [PATCH] fix order/invoice errors in invoice worker --- shop/management/commands/invoice-worker.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shop/management/commands/invoice-worker.py b/shop/management/commands/invoice-worker.py index f3c35552..77c8486f 100644 --- a/shop/management/commands/invoice-worker.py +++ b/shop/management/commands/invoice-worker.py @@ -52,11 +52,11 @@ class Command(BaseCommand): for invoice in Invoice.objects.filter(sent_to_customer=False, pdf__isnull=False): # send the email if send_invoice_email(invoice=invoice): - self.stdout.write('OK: Invoice email sent to %s' % order.user.email) + self.stdout.write('OK: Invoice email sent to %s' % invoice.order.user.email) invoice.sent_to_customer=True invoice.save() else: - self.stdout.write('ERROR: Unable to send invoice email for order %s to %s' % (order.pk, order.user.email)) + self.stdout.write('ERROR: Unable to send invoice email for order %s to %s' % (invoice.order.pk, invoice.order.user.email)) ### pause for a bit sleep(60)