Add fields into vary even if they dont have a value

pull/965/head
Karl Hobley 2015-02-04 20:58:10 +00:00
rodzic 09f053ce1e
commit 0564bd6880
2 zmienionych plików z 3 dodań i 4 usunięć

Wyświetl plik

@ -303,9 +303,8 @@ 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:
vary.append(str(value))
value = getattr(image, field, '')
vary.append(str(value))
return vary

Wyświetl plik

@ -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(