From a8be148904e17b16a853128716a17a60c98aec5e Mon Sep 17 00:00:00 2001 From: Joaquim d'Souza Date: Thu, 20 Jun 2024 15:00:24 +0200 Subject: [PATCH] fix: fail gracefully when loading members with no postcode data --- hub/graphql/types/model_types.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hub/graphql/types/model_types.py b/hub/graphql/types/model_types.py index 37c6ec3d2..f26481a65 100644 --- a/hub/graphql/types/model_types.py +++ b/hub/graphql/types/model_types.py @@ -632,6 +632,8 @@ class GenericData(CommonData): @strawberry_django.field def postcode_data(self) -> Optional[PostcodesIOResult]: + if not self.postcode_data: + return None return benedict(self.postcode_data) @strawberry_django.field