Skip to content

Commit d1f111c

Browse files
authored
Remove provision for missing fields on Hit (#4027)
1 parent 804f70d commit d1f111c

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

api/api/serializers/base.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ def build_property_field(self, field_name, model_class):
1616
"""
1717

1818
klass, kwargs = super().build_property_field(field_name, model_class)
19-
kwargs |= {
20-
"allow_null": True, # model computed properties are not present in ``Hit``
21-
}
2219
if doc := getattr(model_class, field_name).__doc__:
2320
kwargs.setdefault("help_text", doc)
2421
return klass, kwargs

api/api/serializers/media_serializers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,7 @@ def to_representation(self, *args, **kwargs):
728728
# Ensure license is lowercase
729729
output["license"] = output["license"].lower()
730730

731-
if output["license_url"] is None:
731+
if output.get("license_url") is None:
732732
output["license_url"] = get_license_url(
733733
output["license"], output["license_version"]
734734
)

0 commit comments

Comments
 (0)