This commit is contained in:
Martin Quarda 2024-10-13 08:37:17 +02:00
parent e45880bd8c
commit 2b58ce8930
2 changed files with 3 additions and 1 deletions

View File

@ -138,6 +138,9 @@ class InvoiceProduct(models.Model):
if data['quantity'] <= 0: if data['quantity'] <= 0:
raise ValidationError("Počet předmětů ve faktuře musí být kladný!") raise ValidationError("Počet předmětů ve faktuře musí být kladný!")
def __str__(self):
return f"<InvoiceProduct {self.product.name} {self.invoice.invoice_id} *{self.quantity}"
class Racer(InvoiceProduct): class Racer(InvoiceProduct):
profile = models.ForeignKey(Profile, related_name='racers', on_delete=models.RESTRICT) profile = models.ForeignKey(Profile, related_name='racers', on_delete=models.RESTRICT)

View File

@ -138,7 +138,6 @@ def register_racer(request):
) )
invoice.save() invoice.save()
racer.save() racer.save()
invoice.items.set([racer.id])
payment_data = { payment_data = {
'merchant': COMGATE_MERCHANT, 'merchant': COMGATE_MERCHANT,