Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Django complains about ungenerated migrations on a fresh project with custom storage class #112

Open
samupl opened this issue Oct 13, 2023 · 1 comment

Comments

@samupl
Copy link
Contributor

samupl commented Oct 13, 2023

In current version (1.6), on a fresh project, django tries to generate migrations that seem to change the storage class and the choices:

> python manage.py makemigrations
Migrations for 'import_export_celery':
  /usr/local/lib/python3.11/site-packages/import_export_celery/migrations/0010_alter_exportjob_file_alter_importjob_change_summary_and_more.py
    - Alter field file on exportjob
    - Alter field change_summary on importjob
    - Alter field file on importjob
  
> cat /usr/local/lib/python3.11/site-packages/import_export_celery/migrations/0010_alter_exportjob_file_alter_importjob_change_summary_and_more.py
# Generated by Django 4.2.1 on 2023-09-23 14:01

import config.custom_storages
from django.db import migrations
import import_export_celery.fields


class Migration(migrations.Migration):

    dependencies = [
        ('import_export_celery', '0009_alter_exportjob_options_alter_importjob_options_and_more'),
    ]

    operations = [
        migrations.AlterField(
            model_name='exportjob',
            name='file',
            field=import_export_celery.fields.ImportExportFileField(max_length=255, storage=config.custom_storages.TempFileStorage(), upload_to='django-import-export-celery-export-jobs', verbose_name='exported file'),
        ),
        migrations.AlterField(
            model_name='importjob',
            name='change_summary',
            field=import_export_celery.fields.ImportExportFileField(blank=True, null=True, storage=config.custom_storages.TempFileStorage(), upload_to='django-import-export-celery-import-change-summaries', verbose_name='Summary of changes made by this import'),
        ),
        migrations.AlterField(
            model_name='importjob',
            name='file',
            field=import_export_celery.fields.ImportExportFileField(max_length=255, storage=config.custom_storages.TempFileStorage(), upload_to='django-import-export-celery-import-jobs', verbose_name='File to be imported'),
        ),
    ]

This is effectivelly the same issue as reported in #30 but the error is different + I prepared a PR with a fix, so I opened a new issue.

@samupl
Copy link
Contributor Author

samupl commented Oct 13, 2023

PR with fix: #113

@heso heso mentioned this issue May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant