mark orders as paid in bootstrap script (#189)

they are marked as payed such that tickets are generated so we can
design the backoffice$
This commit is contained in:
Stephan Telling 2017-12-12 22:13:38 +01:00 committed by Thomas Steen Rasmussen
parent 8595377066
commit 93a827bf7e
2 changed files with 8 additions and 1 deletions

View file

@ -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()

View file

@ -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(