Skip to content

Commit

Permalink
Remove provision for missing fields on Hit (#4027)
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruvkb authored Apr 4, 2024
1 parent 804f70d commit d1f111c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 0 additions & 3 deletions api/api/serializers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ def build_property_field(self, field_name, model_class):
"""

klass, kwargs = super().build_property_field(field_name, model_class)
kwargs |= {
"allow_null": True, # model computed properties are not present in ``Hit``
}
if doc := getattr(model_class, field_name).__doc__:
kwargs.setdefault("help_text", doc)
return klass, kwargs
2 changes: 1 addition & 1 deletion api/api/serializers/media_serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ def to_representation(self, *args, **kwargs):
# Ensure license is lowercase
output["license"] = output["license"].lower()

if output["license_url"] is None:
if output.get("license_url") is None:
output["license_url"] = get_license_url(
output["license"], output["license_version"]
)
Expand Down

0 comments on commit d1f111c

Please sign in to comment.