From 3c270d8a294a2ad961f9161ee9ddbd671c4627d4 Mon Sep 17 00:00:00 2001 From: Dylan Hillerbrand Date: Wed, 12 Jun 2024 13:11:21 -0400 Subject: [PATCH] fix: Account for bad alignment flag in EditSyllabificationView This flag was introduced in v1.1.0 of volpiano-display-utilities --- django/cantusdb_project/main_app/tests/test_views.py | 4 ++-- django/cantusdb_project/main_app/views/chant.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/django/cantusdb_project/main_app/tests/test_views.py b/django/cantusdb_project/main_app/tests/test_views.py index e59845bd4..bf60cf2e4 100644 --- a/django/cantusdb_project/main_app/tests/test_views.py +++ b/django/cantusdb_project/main_app/tests/test_views.py @@ -3644,11 +3644,11 @@ def test_edit_syllabification(self): self.assertEqual(chant.manuscript_syllabized_full_text, "lorem ipsum") response = self.client.post( f"/edit-syllabification/{chant.id}", - {"manuscript_syllabized_full_text": "lo-rem ip-sum"}, + {"manuscript_syllabized_full_text": "lore-m i-psum"}, ) self.assertEqual(response.status_code, 302) # 302 Found chant.refresh_from_db() - self.assertEqual(chant.manuscript_syllabized_full_text, "lo-rem ip-sum") + self.assertEqual(chant.manuscript_syllabized_full_text, "lore-m i-psum") class FeastListViewTest(TestCase): diff --git a/django/cantusdb_project/main_app/views/chant.py b/django/cantusdb_project/main_app/views/chant.py index 7c743ee2e..4b16a9489 100644 --- a/django/cantusdb_project/main_app/views/chant.py +++ b/django/cantusdb_project/main_app/views/chant.py @@ -1193,7 +1193,7 @@ def get_initial(self): initial = super().get_initial() chant = self.get_object() has_syl_text = bool(chant.manuscript_syllabized_full_text) - syls_text = syllabify_text( + syls_text, _ = syllabify_text( text=chant.get_best_text_for_syllabizing(), clean_text=True, text_presyllabified=has_syl_text,