fix(core): Ensure linked ticket models are unique

ref: #691 #681
This commit is contained in:
2025-03-17 19:43:32 +09:30
parent 983311dda5
commit 8abced87de
2 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,17 @@
# Generated by Django 5.1.5 on 2025-03-17 08:33
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0018_alter_ticketlinkeditem_item_type'),
]
operations = [
migrations.AlterUniqueTogether(
name='ticketlinkeditem',
unique_together={('ticket', 'item_type', 'item')},
),
]

View File

@ -25,6 +25,12 @@ class TicketLinkedItem(TenancyObject):
'id'
]
unique_together = (
'ticket',
'item_type',
'item',
)
verbose_name = 'Ticket Linked Item'
verbose_name_plural = 'Ticket linked Items'