From f7362015d4b8e1fcdfc1992a505a00489dd11b60 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Pasquier <contact@jbpasquier.eu> Date: Fri, 9 Oct 2020 10:43:13 +0000 Subject: [PATCH] fix: getattr instead of flat SERIALIZER_CACHE --- djangoldp/serializers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/djangoldp/serializers.py b/djangoldp/serializers.py index 90dba776..6fc13ee3 100644 --- a/djangoldp/serializers.py +++ b/djangoldp/serializers.py @@ -58,7 +58,7 @@ class LDListMixin: '''A Mixin for serializing containers into JSONLD format''' child_attr = 'child' - with_cache = settings.SERIALIZER_CACHE + with_cache = getattr(settings, 'SERIALIZER_CACHE', True) to_representation_cache = InMemoryCache() @@ -304,7 +304,7 @@ class LDPSerializer(HyperlinkedModelSerializer): serializer_url_field = JsonLdIdentityField ModelSerializer.serializer_field_mapping[LDPUrlField] = IdURLField - with_cache = settings.SERIALIZER_CACHE + with_cache = getattr(settings, 'SERIALIZER_CACHE', True) to_representation_cache = InMemoryCache() -- GitLab