# Generated by Django 4.0.7 on 2022-08-10 16:26

from django import VERSION as DJANGO_VERSION
from django.db import migrations
import wagtail.images.models


class Migration(migrations.Migration):

    dependencies = [
        ("wagtailimages", "0024_index_image_file_hash"),
    ]

    rendition_file_options = {
        "height_field": "height",
        "upload_to": wagtail.images.models.get_rendition_upload_to,
        "width_field": "width",
    }
    # See https://code.djangoproject.com/ticket/34192 - prior to Django 4.2, a callable storage
    # argument that returns default_storage would be incorrectly omitted from the deconstructed
    # field. We need to match that behaviour and include/omit it accordingly to prevent
    # makemigrations from seeing a difference and generating a spurious migration in
    # wagtail.images.
    if DJANGO_VERSION >= (4, 2):
        rendition_file_options["storage"] = wagtail.images.models.get_rendition_storage

    operations = [
        migrations.AlterField(
            model_name="image",
            name="file",
            field=wagtail.images.models.WagtailImageField(
                height_field="height",
                upload_to=wagtail.images.models.get_upload_to,
                verbose_name="file",
                width_field="width",
            ),
        ),
        migrations.AlterField(
            model_name="rendition",
            name="file",
            field=wagtail.images.models.WagtailImageField(**rendition_file_options),
        ),
    ]
