fix: metadata fields for migration rules #2163
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What are the relevant tickets?
Relates to mitodl/ocw-hugo-projects#292
Description (What does it do?)
With mitodl/ocw-hugo-projects#292 merged, the default metadata will have a
title
field. When migration is run on older data to create new external resource objects, those objects will have atitle
in their metadata field. This will cause the menu item selection UI to misbehave on Studio. This is because it preferswebsite_content.metadata.title
overwebsite_content.title
(which is the default location of the title).This PR prevents
title
from being added to the metadata and keeps the structure consistent with what normal flow gets us.This PR also fixes a spelling error in a field name
has_external_licence_warning
->has_external_license_warning
.How can this be tested?
ocw-studio
setup.external-resource-add-title-field
.docker compose exec web ./manage.py markdown_cleanup link_to_external_resource --skip-sync --commit --filter your-course-id
title
field.has_external_license_warning
field with these exact spellings.