Create workflow to add chants to a source from a csv file. #1770
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.
Closes #1259. The new page can be found at
source/<source id>/add-chants
.The page provides a preview of a selected CSV file, and various validations are made and signaled to the user with alerts and tooltips:
Additional validation occurs on the back-end.
Along the way, refactored or fixed the following:
JSONResponseMixin
that does content negotiation for a number of views had an error that caused it not to work nicely withListView
s that had more than one page. This fixes that error by making use of theobject_list
attribute, rather than the queryset passed to theListView
context.FeastListView
andFeastDetailView
were not previously using theJSONResponseMixin
, but it was useful for the front-end mapping and validation of feasts for this feature, so I added it.AddImageLinksView
and the view for this PR into a newsource_bulk_actions
directory and added some typing to autocomplete views.ChantCreateForm
, we were validating the uniqueness of the sequence and folio of a new chant regardless of whether the field-level validation of the form had succeeded. But this meant that a form submitted with an empty folio or sequence (an invalid form) would still attempt to validate that the folio-sequence combination was unique, and would error because there was no value for that field. Now, we only complete the validation of the combination if the field values are all valid.