From 4b914398d4b369cee97e855375f93a0c48001e51 Mon Sep 17 00:00:00 2001 From: Fabian Braun Date: Wed, 21 Aug 2024 00:37:22 +0200 Subject: [PATCH] Fix imports --- djangocms_text/migrations/0003_auto_20240702_1409.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/djangocms_text/migrations/0003_auto_20240702_1409.py b/djangocms_text/migrations/0003_auto_20240702_1409.py index 6f8cbcf1..de5b1e99 100644 --- a/djangocms_text/migrations/0003_auto_20240702_1409.py +++ b/djangocms_text/migrations/0003_auto_20240702_1409.py @@ -1,6 +1,6 @@ # Generated by Django 3.2.25 on 2024-07-02 14:09 -from django.db import connection, migrations, models +from django.db import migrations, models def migrate_text_ckeditor_fields(apps, schema_editor): @@ -20,14 +20,14 @@ class Meta: json = models.JSONField(blank=True, null=True) rte = models.CharField(max_length=16, blank=True) - if CKEditorText._meta.db_table in connection.introspection.table_names(): + if CKEditorText._meta.db_table in schema_editor.connection.introspection.table_names(): existing_texts = Text_Text.objects.all().values_list("cmsplugin_ptr_id", flat=True) qs = CKEditorText.objects.using(schema_editor.connection.alias).exclude(cmsplugin_ptr_id__in=existing_texts) Text_Text.objects.using(schema_editor.connection.alias).bulk_create( Text_Text(body=ckeditor_text.body, rte="text_ckeditor4", cmsplugin_ptr_id=ckeditor_text.cmsplugin_ptr_id) for ckeditor_text in qs ) - + class Migration(migrations.Migration):