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

Handle errors with improper chant text field characters/syllabification fails #1653

Merged
merged 5 commits into from
Oct 11, 2024

Conversation

dchiller
Copy link
Contributor

@dchiller dchiller commented Oct 4, 2024

Adds custom validators to all forms involving chant texts (chant create, chant edit, and syllabification edit) so that invalid texts cannot be saved.

Nests most attempted syllabifications and text-melody alignments in try blocks so that existing syllabification errors won't cause pages to fail to load.

Does some refactoring on a variety of test_views.test_chant.py tests to simplify, remove duplicate tests, and catch linting errors. In particular, two tests (test_view_url_reverse_name and test_template_used) repeated the logic of other tests for the same view (test_url_and_templates and test_view_url_path).

Closes #1423. Closes #1626.

Reduces duplicate queries in the source create view.

Removes a function that contained a duplicate test for the existence of a source.
Modifies chant create, edit, and detail views to prevent and catch text syllabification errors. Modifies edit syllabification view for the same.

Invalidates chant text fields if they error on syllabification.

Catches errors for texts with error rather than propagating to a server error.
required=True,
)

manuscript_full_text = CantusDBLatinField(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love this.

@dchiller dchiller merged commit 97a13c6 into DDMAL:develop Oct 11, 2024
1 check passed
@dchiller dchiller deleted the handle-latin-errors branch October 11, 2024 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants