prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Setting WAGTAILIMAGES_RENDITION_STORAGE generates a migration in wagtailimages
  ### Issue Summary
  
  Running `./manage.py makemigrations` while WAGTAILIMAGES_RENDITION_STORAGE is set to something other than the default storage causes a migration to be generated within the wagtailimages app
  
  ### Steps to Reproduce
  
  1. (for example) Start a new project with `wagtail start myproject`
  2. Run `./manage.py migrate` and `./manage.py makemigrations`; this outputs "No changes detected"
  3. `pip install django-storages`
  4. Add the line `WAGTAILIMAGES_RENDITION_STORAGE = "storages.backends.s3boto3.S3Boto3Storage"` to myproject/settings/base.py
  5. Run `./manage.py makemigrations`; this generates a migration `wagtail/images/migrations/0026_alter_rendition_file.py` that adds a `storage` argument to the Rendition.file field.
  
  -   I have confirmed that this issue can be reproduced as described on a fresh Wagtail project: yes
  
  ### Technical details
  
  -   Python version: 3.8.0
  -   Django version: 4.1.3
  -   Wagtail version: main (4.2a0, 4b770784ca68f22d5ea58ecbd01e5c8c13882a3d)
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `wagtail/images/migrations/0025_alter_image_file_alter_rendition_file.py`
  Content:
  ```
  1 # Generated by Django 4.0.7 on 2022-08-10 16:26
  2 
  3 from django.db import migrations
  4 import wagtail.images.models
  5 
  6 
  7 class Migration(migrations.Migration):
  8 
  9     dependencies = [
  10         ("wagtailimages", "0024_index_image_file_hash"),
  11     ]
  12 
  13     operations = [
  14         migrations.AlterField(
  15             model_name="image",
  16             name="file",
  17             field=wagtail.images.models.WagtailImageField(
  18                 height_field="height",
  19                 upload_to=wagtail.images.models.get_upload_to,
  20                 verbose_name="file",
  21                 width_field="width",
  22             ),
  23         ),
  24         migrations.AlterField(
  25             model_name="rendition",
  26             name="file",
  27             field=wagtail.images.models.WagtailImageField(
  28                 height_field="height",
  29                 upload_to=wagtail.images.models.get_rendition_upload_to,
  30                 width_field="width",
  31             ),
  32         ),
  33     ]
  34
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/wagtail/images/migrations/0025_alter_image_file_alter_rendition_file.py b/wagtail/images/migrations/0025_alter_image_file_alter_rendition_file.py
  --- a/wagtail/images/migrations/0025_alter_image_file_alter_rendition_file.py
  +++ b/wagtail/images/migrations/0025_alter_image_file_alter_rendition_file.py
  @@ -1,5 +1,6 @@
   # 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
   
  @@ -10,6 +11,19 @@
           ("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",
  @@ -24,10 +38,6 @@
           migrations.AlterField(
               model_name="rendition",
               name="file",
  -            field=wagtail.images.models.WagtailImageField(
  -                height_field="height",
  -                upload_to=wagtail.images.models.get_rendition_upload_to,
  -                width_field="width",
  -            ),
  +            field=wagtail.images.models.WagtailImageField(**rendition_file_options),
           ),
       ]
  
verification_info: {"golden_diff": "diff --git a/wagtail/images/migrations/0025_alter_image_file_alter_rendition_file.py b/wagtail/images/migrations/0025_alter_image_file_alter_rendition_file.py\n--- a/wagtail/images/migrations/0025_alter_image_file_alter_rendition_file.py\n+++ b/wagtail/images/migrations/0025_alter_image_file_alter_rendition_file.py\n@@ -1,5 +1,6 @@\n # Generated by Django 4.0.7 on 2022-08-10 16:26\r\n \r\n+from django import VERSION as DJANGO_VERSION\r\n from django.db import migrations\r\n import wagtail.images.models\r\n \r\n@@ -10,6 +11,19 @@\n         (\"wagtailimages\", \"0024_index_image_file_hash\"),\r\n     ]\r\n \r\n+    rendition_file_options = {\r\n+        \"height_field\": \"height\",\r\n+        \"upload_to\": wagtail.images.models.get_rendition_upload_to,\r\n+        \"width_field\": \"width\",\r\n+    }\r\n+    # See https://code.djangoproject.com/ticket/34192 - prior to Django 4.2, a callable storage\r\n+    # argument that returns default_storage would be incorrectly omitted from the deconstructed\r\n+    # field. We need to match that behaviour and include/omit it accordingly to prevent\r\n+    # makemigrations from seeing a difference and generating a spurious migration in\r\n+    # wagtail.images.\r\n+    if DJANGO_VERSION >= (4, 2):\r\n+        rendition_file_options[\"storage\"] = wagtail.images.models.get_rendition_storage\r\n+\r\n     operations = [\r\n         migrations.AlterField(\r\n             model_name=\"image\",\r\n@@ -24,10 +38,6 @@\n         migrations.AlterField(\r\n             model_name=\"rendition\",\r\n             name=\"file\",\r\n-            field=wagtail.images.models.WagtailImageField(\r\n-                height_field=\"height\",\r\n-                upload_to=wagtail.images.models.get_rendition_upload_to,\r\n-                width_field=\"width\",\r\n-            ),\r\n+            field=wagtail.images.models.WagtailImageField(**rendition_file_options),\r\n         ),\r\n     ]\n", "issue": "Setting WAGTAILIMAGES_RENDITION_STORAGE generates a migration in wagtailimages\n### Issue Summary\r\n\r\nRunning `./manage.py makemigrations` while WAGTAILIMAGES_RENDITION_STORAGE is set to something other than the default storage causes a migration to be generated within the wagtailimages app\r\n\r\n### Steps to Reproduce\r\n\r\n1. (for example) Start a new project with `wagtail start myproject`\r\n2. Run `./manage.py migrate` and `./manage.py makemigrations`; this outputs \"No changes detected\"\r\n3. `pip install django-storages`\r\n4. Add the line `WAGTAILIMAGES_RENDITION_STORAGE = \"storages.backends.s3boto3.S3Boto3Storage\"` to myproject/settings/base.py\r\n5. Run `./manage.py makemigrations`; this generates a migration `wagtail/images/migrations/0026_alter_rendition_file.py` that adds a `storage` argument to the Rendition.file field.\r\n\r\n-   I have confirmed that this issue can be reproduced as described on a fresh Wagtail project: yes\r\n\r\n### Technical details\r\n\r\n-   Python version: 3.8.0\r\n-   Django version: 4.1.3\r\n-   Wagtail version: main (4.2a0, 4b770784ca68f22d5ea58ecbd01e5c8c13882a3d)\r\n\n", "before_files": [{"content": "# Generated by Django 4.0.7 on 2022-08-10 16:26\r\n\r\nfrom django.db import migrations\r\nimport wagtail.images.models\r\n\r\n\r\nclass Migration(migrations.Migration):\r\n\r\n    dependencies = [\r\n        (\"wagtailimages\", \"0024_index_image_file_hash\"),\r\n    ]\r\n\r\n    operations = [\r\n        migrations.AlterField(\r\n            model_name=\"image\",\r\n            name=\"file\",\r\n            field=wagtail.images.models.WagtailImageField(\r\n                height_field=\"height\",\r\n                upload_to=wagtail.images.models.get_upload_to,\r\n                verbose_name=\"file\",\r\n                width_field=\"width\",\r\n            ),\r\n        ),\r\n        migrations.AlterField(\r\n            model_name=\"rendition\",\r\n            name=\"file\",\r\n            field=wagtail.images.models.WagtailImageField(\r\n                height_field=\"height\",\r\n                upload_to=wagtail.images.models.get_rendition_upload_to,\r\n                width_field=\"width\",\r\n            ),\r\n        ),\r\n    ]\r\n", "path": "wagtail/images/migrations/0025_alter_image_file_alter_rendition_file.py"}], "after_files": [{"content": "# Generated by Django 4.0.7 on 2022-08-10 16:26\r\n\r\nfrom django import VERSION as DJANGO_VERSION\r\nfrom django.db import migrations\r\nimport wagtail.images.models\r\n\r\n\r\nclass Migration(migrations.Migration):\r\n\r\n    dependencies = [\r\n        (\"wagtailimages\", \"0024_index_image_file_hash\"),\r\n    ]\r\n\r\n    rendition_file_options = {\r\n        \"height_field\": \"height\",\r\n        \"upload_to\": wagtail.images.models.get_rendition_upload_to,\r\n        \"width_field\": \"width\",\r\n    }\r\n    # See https://code.djangoproject.com/ticket/34192 - prior to Django 4.2, a callable storage\r\n    # argument that returns default_storage would be incorrectly omitted from the deconstructed\r\n    # field. We need to match that behaviour and include/omit it accordingly to prevent\r\n    # makemigrations from seeing a difference and generating a spurious migration in\r\n    # wagtail.images.\r\n    if DJANGO_VERSION >= (4, 2):\r\n        rendition_file_options[\"storage\"] = wagtail.images.models.get_rendition_storage\r\n\r\n    operations = [\r\n        migrations.AlterField(\r\n            model_name=\"image\",\r\n            name=\"file\",\r\n            field=wagtail.images.models.WagtailImageField(\r\n                height_field=\"height\",\r\n                upload_to=wagtail.images.models.get_upload_to,\r\n                verbose_name=\"file\",\r\n                width_field=\"width\",\r\n            ),\r\n        ),\r\n        migrations.AlterField(\r\n            model_name=\"rendition\",\r\n            name=\"file\",\r\n            field=wagtail.images.models.WagtailImageField(**rendition_file_options),\r\n        ),\r\n    ]\r\n", "path": "wagtail/images/migrations/0025_alter_image_file_alter_rendition_file.py"}]}