kopia lustrzana https://github.com/wagtail/wagtail
Remove Django <4.2 fallback code from images migrations
(these files were using CRLF line endings for some reason; changed to LF)pull/12243/head
rodzic
c7a42c4b34
commit
4e6eaab241
|
@ -1,43 +1,36 @@
|
|||
# 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),
|
||||
),
|
||||
]
|
||||
# Generated by Django 4.0.7 on 2022-08-10 16:26
|
||||
|
||||
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",
|
||||
"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),
|
||||
),
|
||||
]
|
||||
|
|
|
@ -1,78 +1,71 @@
|
|||
# Generated by Django 4.0.7 on 2022-10-19 00:20
|
||||
|
||||
from django import VERSION as DJANGO_VERSION
|
||||
from django.db import migrations
|
||||
import wagtail.images.models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("tests", "0009_alter_eventpage_options"),
|
||||
]
|
||||
|
||||
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="customimage",
|
||||
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="customimagefilepath",
|
||||
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="customimagewithauthor",
|
||||
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="customrendition",
|
||||
name="file",
|
||||
field=wagtail.images.models.WagtailImageField(**rendition_file_options),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="customrenditionwithauthor",
|
||||
name="file",
|
||||
field=wagtail.images.models.WagtailImageField(**rendition_file_options),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="customrestaurantimage",
|
||||
name="file",
|
||||
field=wagtail.images.models.WagtailImageField(
|
||||
height_field="height",
|
||||
upload_to=wagtail.images.models.get_upload_to,
|
||||
verbose_name="file",
|
||||
width_field="width",
|
||||
),
|
||||
),
|
||||
]
|
||||
# Generated by Django 4.0.7 on 2022-10-19 00:20
|
||||
|
||||
from django.db import migrations
|
||||
import wagtail.images.models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("tests", "0009_alter_eventpage_options"),
|
||||
]
|
||||
|
||||
rendition_file_options = {
|
||||
"height_field": "height",
|
||||
"upload_to": wagtail.images.models.get_rendition_upload_to,
|
||||
"width_field": "width",
|
||||
"storage": wagtail.images.models.get_rendition_storage,
|
||||
}
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name="customimage",
|
||||
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="customimagefilepath",
|
||||
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="customimagewithauthor",
|
||||
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="customrendition",
|
||||
name="file",
|
||||
field=wagtail.images.models.WagtailImageField(**rendition_file_options),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="customrenditionwithauthor",
|
||||
name="file",
|
||||
field=wagtail.images.models.WagtailImageField(**rendition_file_options),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="customrestaurantimage",
|
||||
name="file",
|
||||
field=wagtail.images.models.WagtailImageField(
|
||||
height_field="height",
|
||||
upload_to=wagtail.images.models.get_upload_to,
|
||||
verbose_name="file",
|
||||
width_field="width",
|
||||
),
|
||||
),
|
||||
]
|
||||
|
|
Ładowanie…
Reference in New Issue