From aef2940e09c52a62e44678dad07f8cc27592ce9b Mon Sep 17 00:00:00 2001 From: etj Date: Fri, 20 Dec 2024 12:53:59 +0100 Subject: [PATCH] Metadata: fix FK handling --- geonode/metadata/handlers/base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/geonode/metadata/handlers/base.py b/geonode/metadata/handlers/base.py index 1b058cb3d55..a9ff33017d0 100644 --- a/geonode/metadata/handlers/base.py +++ b/geonode/metadata/handlers/base.py @@ -134,7 +134,7 @@ def serialize(cls, db_value): @classmethod def deserialize(cls, field_value): - return RestrictionCodeType.objects.get(identifier=field_value) + return RestrictionCodeType.objects.get(identifier=field_value) if field_value else None class SpatialRepresentationTypeSubHandler(SubHandler): @@ -153,7 +153,7 @@ def serialize(cls, db_value): @classmethod def deserialize(cls, field_value): - return SpatialRepresentationType.objects.get(identifier=field_value) + return SpatialRepresentationType.objects.get(identifier=field_value) if field_value else None SUBHANDLERS = {