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

Merge develop into staging, 22 Oct 2024 #1678

Merged
merged 9 commits into from
Oct 22, 2024
26 changes: 14 additions & 12 deletions django/cantusdb_project/main_app/forms.py
Original file line number Diff line number Diff line change
@@ -89,13 +89,14 @@ class CantusDBLatinField(forms.CharField):

def validate(self, value):
super().validate(value)
if value:
try:
syllabify_text(value)
except LatinError as err:
raise forms.ValidationError(str(err))
except ValueError as exc:
raise forms.ValidationError("Invalid characters in text.") from exc
# Temporarily turn off validation; see #1674
# if value:
# try:
# syllabify_text(value)
# except LatinError as err:
# raise forms.ValidationError(str(err))
# except ValueError as exc:
# raise forms.ValidationError("Invalid characters in text.") from exc


class CantusDBSyllabifiedLatinField(forms.CharField):
@@ -107,11 +108,12 @@ class CantusDBSyllabifiedLatinField(forms.CharField):

def validate(self, value):
super().validate(value)
if value:
try:
syllabify_text(value, text_presyllabified=True)
except ValueError as exc:
raise forms.ValidationError("Invalid characters in text.") from exc
# Temporarily turn off validation; see #1674
# if value:
# try:
# syllabify_text(value, text_presyllabified=True)
# except ValueError as exc:
# raise forms.ValidationError("Invalid characters in text.") from exc


class StyledChoiceField(forms.ChoiceField):
Original file line number Diff line number Diff line change
@@ -291,7 +291,7 @@ <h3>Create Chant</h3>
{% block lowersidebar %}
<div class="card w-100 mb-3">
<div class="card-header">
<h5><a id="source" href="{% url 'source-detail' source.id %}">{{ source.siglum }}</a></h5>
<h5><a id="source" href="{% url 'source-detail' source.id %}">{{ source.short_heading }}</a></h5>
</div>
</div>

6 changes: 3 additions & 3 deletions django/cantusdb_project/main_app/templates/chant_detail.html
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@ <h3>{{ chant.incipit }}</h3>
<div class="col">
<dt>Source</dt>
<dd>
<a href="{% url 'source-detail' chant.source.id %}">{{ chant.source.title }}</a>
<a href="{% url 'source-detail' chant.source.id %}">{{ chant.source.heading }}</a>
</dd>
</div>
{% endif %}
@@ -312,7 +312,7 @@ <h4>List of melodies</h4>
<b>Source navigation</b>
<br>
{% if source %}
<a href="{% url 'source-detail' source.id %}" title="{{ source.title }}"> <b>{{ source.siglum }}</b> </a>
<a href="{% url 'source-detail' source.id %}" title="{{ source.heading }}"> <b>{{ source.short_heading }}</b> </a>
{% else %}
This chant is not associated with any source.
{% endif %}
@@ -465,7 +465,7 @@ <h4>List of melodies</h4>
<div class="card-header">
<small><a href="/sources?segment={{ source.segment.id }}">{{ source.segment.name }}</a></small>
<br>
<span title="{{ source.title }}">{{ source.siglum }}</span>
<span title="{{ source.heading }}">{{ source.short_heading }}</span>
</div>
<div class=" card-body">
<small>
8 changes: 4 additions & 4 deletions django/cantusdb_project/main_app/templates/chant_edit.html
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
{% load static %}

{% block title %}
<title>{{ source.title }} | Cantus Database</title>
<title>{{ source.heading }} | Cantus Database</title>
{% endblock %}

{% block scripts %}
@@ -362,8 +362,8 @@ <h3>Full text &amp; Volpiano edit form</h3>
<dd><small>5) Click <b>"SAVE"</b></small></dd>
</dl>
<div style="margin-top:5px;">
<a href="{% url 'source-detail' source.id %}" title="{{ source.title }}">
{{ source.siglum }}
<a href="{% url 'source-detail' source.id %}" title="{{ source.heading }}">
{{ source.short_heading }}
</a>
</div>
<div style="margin-top:5px;">
@@ -382,7 +382,7 @@ <h3>Full text &amp; Volpiano edit form</h3>
{% block lowersidebar %}
<div class="card mb-3 w-100">
<div class="card-header">
<h4><a href="{% url 'source-detail' source.id %}" title="{{ source.title }}">{{ source.siglum }}</a></h4>
<h4><a href="{% url 'source-detail' source.id %}" title="{{ source.heading }}">{{ source.short_heading }}</a></h4>
</div>
<div class="card-body">
{% if source.chant_set.exists %}
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@
<body>
<title>Inventory | Cantus Database</title>
<h3>Cantus Inventory:
<a href="{% url 'source-detail' source.id %}" target="_href">{{ source.title }}</a>
<a href="{% url 'source-detail' source.id %}" target="_href">{{ source.heading }}</a>
</h3>
This source inventory contains {{ chants.count }} chants.
<table class="table table-sm small table-bordered table-striped table-hover">
Original file line number Diff line number Diff line change
@@ -250,7 +250,7 @@ <h3>
{% block lowersidebar %}
<div class="card mb-3 w-100">
<div class="card-header">
<h4>{{ source.siglum }}</h4>
<h4>{{ source.short_heading }}</h4>
</div>
<div class="card-body">
<small>
Original file line number Diff line number Diff line change
@@ -64,7 +64,7 @@ <h5>Entered Melodies</h5>
<ul>
{% for source in melody_sources %}
<li>
<a href="{% url 'source-detail' source.id %}" title="{{ source.title }}">{{ source.siglum }}</a> ({{ source.title }})
<a href="{% url 'source-detail' source.id %}" title="{{ source.heading }}">{{ source.short_heading }}</a> ({{ source.heading }})
</li>
{% endfor %}
</ul>
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@
"""

from unittest.mock import patch
from unittest import skip
import random
from typing import ClassVar

@@ -322,6 +323,7 @@ def test_proofread_chant(self):
chant.refresh_from_db()
self.assertIs(chant.manuscript_full_text_std_proofread, True)

@skip("Temporarily disabled due to #1674")
def test_invalid_text(self) -> None:
"""
The user should not be able to create a chant with invalid text
@@ -3000,6 +3002,7 @@ def test_suggested_chant_buttons(self) -> None:
)
self.assertIsNone(response_after_rare_chant.context["suggested_chants"])

@skip("Temporarily disabled due to #1674")
def test_invalid_text(self) -> None:
"""
The user should not be able to create a chant with invalid text
10 changes: 5 additions & 5 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ package-mode = false

[tool.poetry.dependencies]
python = "^3.9"
Django = "4.2.14"
Django = "4.2.16"
django-autocomplete-light = "3.9.4"
django-extra-views = "0.13.0"
django-quill-editor = "0.1.40"