From 353fc5bddea7b74dc16529c357a65990c057b860 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, 1 insertion(+), 1 deletion(-) diff --git a/hub/graphql/types/model_types.py b/hub/graphql/types/model_types.py index 37c6ec3d2..398e1a778 100644 --- a/hub/graphql/types/model_types.py +++ b/hub/graphql/types/model_types.py @@ -632,7 +632,7 @@ class GenericData(CommonData): @strawberry_django.field def postcode_data(self) -> Optional[PostcodesIOResult]: - return benedict(self.postcode_data) + return benedict(self.postcode_data or {}) @strawberry_django.field def areas(self, info: Info) -> Optional[Area]: