This commit is contained in:
Martin Quarda 2024-10-13 08:21:07 +02:00
parent 476b186589
commit bf75f6bddb

View File

@ -126,8 +126,16 @@ def register_racer(request):
product.quantity -= 1 product.quantity -= 1
product.save() product.save()
invoice = Invoice(
invoice_id=invoice_id,
user=user,
total_price=price,
address=profile.address,
)
racer.save()
racer = Racer( racer = Racer(
product=product, product=product,
invoice=invoice,
quantity=1, quantity=1,
profile = profile, profile = profile,
first_name = request.POST['first_name'], first_name = request.POST['first_name'],
@ -139,13 +147,6 @@ def register_racer(request):
alkator_class = ALKATOR_CLASS, alkator_class = ALKATOR_CLASS,
price=price, price=price,
) )
invoice = Invoice(
invoice_id=invoice_id,
user=user,
total_price=price,
address=profile.address,
)
racer.save()
invoice.items.set([racer]) invoice.items.set([racer])
invoice.save() invoice.save()