Skip to content

Commit

Permalink
Metadata: fix FK handling
Browse files Browse the repository at this point in the history
  • Loading branch information
etj committed Dec 20, 2024
1 parent bacbe51 commit aef2940
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions geonode/metadata/handlers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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 = {
Expand Down

0 comments on commit aef2940

Please sign in to comment.