Skip to content

Commit

Permalink
Merge pull request #1680 from DDMAL/staging
Browse files Browse the repository at this point in the history
Merge `staging` into `production`, 22 Oct 2024
  • Loading branch information
dchiller authored Oct 22, 2024
2 parents 5f920d0 + 64db87e commit 0122510
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 29 deletions.
26 changes: 14 additions & 12 deletions django/cantusdb_project/main_app/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
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
Expand Up @@ -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 %}
Expand Down Expand Up @@ -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 %}
Expand Down Expand Up @@ -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>
Expand Down
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
Expand Up @@ -2,7 +2,7 @@
{% load static %}

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

{% block scripts %}
Expand Down Expand Up @@ -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;">
Expand All @@ -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 %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"""

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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
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
Expand Up @@ -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"
Expand Down

0 comments on commit 0122510

Please sign in to comment.