mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-04-23 08:04:46 +00:00
Eliminate deprecated use of wagtailimages.Filter as a model from modeladmin
This commit is contained in:
parent
a002bb8c39
commit
b11c8a9a0b
2 changed files with 2 additions and 3 deletions
|
|
@ -87,8 +87,7 @@ class ThumbnailMixin(object):
|
|||
'class': self.thumb_classname,
|
||||
}
|
||||
if image:
|
||||
fltr, _ = Filter.objects.get_or_create(
|
||||
spec=self.thumb_image_filter_spec)
|
||||
fltr = Filter(spec=self.thumb_image_filter_spec)
|
||||
img_attrs.update({'src': image.get_rendition(fltr).url})
|
||||
return mark_safe('<img{}>'.format(flatatt(img_attrs)))
|
||||
elif self.thumb_default:
|
||||
|
|
|
|||
|
|
@ -889,7 +889,7 @@ class InspectView(InstanceSpecificView):
|
|||
""" Render an image """
|
||||
image = getattr(self.instance, field_name)
|
||||
if image:
|
||||
fltr, _ = Filter.objects.get_or_create(spec='max-400x400')
|
||||
fltr = Filter(spec='max-400x400')
|
||||
rendition = image.get_rendition(fltr)
|
||||
return rendition.img_tag
|
||||
return self.model_admin.get_empty_value_display(field_name)
|
||||
|
|
|
|||
Loading…
Reference in a new issue