Skip to content

Set self href on items and children when adding #294

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

Merged
merged 4 commits into from
Mar 29, 2021

Conversation

matthewhanson
Copy link
Member

Related Issue(s): #
#284

Description:
When an existing catalog and an item or child is added to it, the self_href was not set which meant that they had to either be set manually, or a call to normalize_hrefs would be needed. This would also happen if generate_subcatalogs was used....all the subcatalogs and items added will need to be normalized.

However, since the catalog already exists, this should be unnecessary. Given a layout strategy, a self href can be determined and set, if the parent has a self href.

Note the only case where a parent does not have a self href is when the catalog is first created in memory and has not yet been saved. In that case a call to normalize is needed

PR Checklist:

  • Code is formatted (run scripts/format)
  • Tests pass (run scripts/test)
  • This PR maintains or improves overall codebase code coverage.
  • Changes are added to the CHANGELOG. See the docs for information about adding to the changelog.

@matthewhanson matthewhanson merged commit a29705f into develop Mar 29, 2021
@matthewhanson matthewhanson deleted the mah/normalize_on_add branch March 29, 2021 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants