Skip to content

Commit 7362135

Browse files
committed
Add ticket type id default
1 parent 9e7ee8b commit 7362135

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ticket/models.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from __future__ import annotations
22

3+
from uuid import uuid4
4+
35
import shortuuid
46
from constance import config
57
from django.contrib.auth import get_user_model
@@ -9,7 +11,7 @@
911

1012

1113
class TicketType(models.Model):
12-
id = models.UUIDField(primary_key=True)
14+
id = models.UUIDField(primary_key=True, default=lambda: str(uuid4()))
1315
name = models.CharField(max_length=100)
1416
price = models.IntegerField()
1517
min_price = models.IntegerField(null=True, blank=True)

0 commit comments

Comments
 (0)