Skip to content

Commit

Permalink
fix(visibilities): don't crash in the suppressable visibility resolver
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
winged authored and czosel committed Oct 16, 2024
1 parent 8038e76 commit 26fd823
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion caluma/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 26fd823

Please sign in to comment.