Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove provision for missing fields on Hit #4027

Merged
merged 2 commits into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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