use category name instead of uuid in settings

This commit is contained in:
Thomas Steen Rasmussen 2017-02-20 17:32:57 +01:00
parent 77f79ec64c
commit eb13b2d6e2

View file

@ -165,8 +165,7 @@ class Order(CreatedUpdatedModel):
self.paid = True
self.open = None
for order_product in self.orderproductrelation_set.all():
category_pk = str(order_product.product.category.pk)
if category_pk == settings.TICKET_CATEGORY_ID:
if order_product.product.category.name == "Tickets":
for _ in range(0, order_product.quantity):
ticket = Ticket(
order=self,