From 26fd82366a8ae3389e3d2d498605bf136cd6924d Mon Sep 17 00:00:00 2001 From: David Vogt Date: Wed, 16 Oct 2024 11:46:23 +0200 Subject: [PATCH] fix(visibilities): don't crash in the suppressable visibility resolver When an optional property is looked up, the default behaviour would be to just return None (in Graphene), but our code called `getattr()` without default param, causing the code to crash. --- caluma/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/caluma/utils.py b/caluma/utils.py index 0286d1e5f..3dcb50e2f 100644 --- a/caluma/utils.py +++ b/caluma/utils.py @@ -154,7 +154,7 @@ def suppressable_visibility_resolver(): # to validate the behavour as we'd usually do. class SuppressableResolver: def __call__(self, inner_self, *args, **kwargs): - return getattr(inner_self, self.prop) + return getattr(inner_self, self.prop, None) @property def _bypass_get_queryset(self): # pragma: no cover