always use get_model in migrations

This commit is contained in:
j3d1 2024-06-23 01:33:24 +02:00
parent 7d1786f143
commit a59509a432
5 changed files with 3 additions and 22 deletions

View file

@ -2,17 +2,15 @@
from django.db import migrations, models
from tickets.models import IssueThread
class Migration(migrations.Migration):
dependencies = [
('tickets', '0005_remove_issuethread_last_activity'),
]
def set_uuid(apps, schema_editor):
import uuid
IssueThread = apps.get_model('tickets', 'IssueThread')
for issue_thread in IssueThread.objects.all():
issue_thread.uuid = str(uuid.uuid4())
issue_thread.save()