kopia lustrzana https://github.com/wagtail/wagtail
Add fields into vary even if they dont have a value
rodzic
09f053ce1e
commit
0564bd6880
|
@ -303,8 +303,7 @@ class Filter(models.Model):
|
|||
|
||||
for operation in self.operations:
|
||||
for field in getattr(operation, 'vary_fields', []):
|
||||
value = getattr(image, field)
|
||||
if value is not None:
|
||||
value = getattr(image, field, '')
|
||||
vary.append(str(value))
|
||||
|
||||
return vary
|
||||
|
|
|
@ -333,7 +333,7 @@ class TestVaryKey(unittest.TestCase):
|
|||
fil = Filter(spec='fill-100x100')
|
||||
vary_key = fil.get_vary_key(image)
|
||||
|
||||
self.assertEqual(vary_key, '')
|
||||
self.assertEqual(vary_key, '2e16d0ba')
|
||||
|
||||
def test_vary_key_fill_filter_with_focal_point(self):
|
||||
image = Image(
|
||||
|
|
Ładowanie…
Reference in New Issue