diff --git a/src/shop/models.py b/src/shop/models.py index 4ebcc7c8..a7ab8953 100644 --- a/src/shop/models.py +++ b/src/shop/models.py @@ -199,7 +199,8 @@ class Order(CreatedUpdatedModel): product=order_product.product, ) ticket.save() - messages.success(request, "Created %s tickets of type: %s" % (order_product.quantity, order_product.product.ticket_type.name)) + if request: + messages.success(request, "Created %s tickets of type: %s" % (order_product.quantity, order_product.product.ticket_type.name)) # and mark the OPR as handed_out=True order_product.handed_out=True order_product.save() diff --git a/src/utils/management/commands/bootstrap-devsite.py b/src/utils/management/commands/bootstrap-devsite.py index d1bf84d1..250f11c2 100644 --- a/src/utils/management/commands/bootstrap-devsite.py +++ b/src/utils/management/commands/bootstrap-devsite.py @@ -364,6 +364,7 @@ class Command(BaseCommand): product=tent1, quantity=1, ) + order0.mark_as_paid(request=None) order1 = Order.objects.create( user=user2, @@ -378,6 +379,8 @@ class Command(BaseCommand): product=tent2, quantity=1, ) + order1.mark_as_paid(request=None) + order2 = Order.objects.create( user=user3, payment_method='cash', @@ -395,6 +398,8 @@ class Command(BaseCommand): product=tent2, quantity=1, ) + order2.mark_as_paid(request=None) + order3 = Order.objects.create( user=user4, payment_method='cash', @@ -412,6 +417,7 @@ class Command(BaseCommand): product=tent1, quantity=1, ) + order3.mark_as_paid(request=None) self.output('Creating eventlocations for {}...'.format(year)) speakers_tent = EventLocation.objects.create(