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, 13 June 2024 #1523

Merged
merged 40 commits into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
3a1c328
chant edit: preserve proofreader fields for contributor changes
lucasmarchd01 Jun 4, 2024
ea46ca4
chant edit: edit typing
lucasmarchd01 Jun 4, 2024
3b3391d
chant edit: change chant object retrieval
lucasmarchd01 Jun 4, 2024
9c64810
chant view: remove unused import
lucasmarchd01 Jun 4, 2024
fda5cc0
Update manage.sh
dchiller Jun 5, 2024
ef589de
edit chant: add typing for user
lucasmarchd01 Jun 5, 2024
38fbd3c
my sources: fix ordering of sources in list and sidebar
lucasmarchd01 Jun 5, 2024
4f3311d
tests: black formatting
lucasmarchd01 Jun 5, 2024
7dc3d2e
Merge pull request #1503 from DDMAL/i1502-manage-docker-path
dchiller Jun 5, 2024
94fba8c
Merge pull request #1504 from lucasmarchd01/issue-1468-2
lucasmarchd01 Jun 5, 2024
3dbbf0b
chant edit: simplify with set() method
lucasmarchd01 Jun 5, 2024
1f70a5d
Merge pull request #1501 from lucasmarchd01/issue-1491
lucasmarchd01 Jun 5, 2024
228eb45
Fixed: Add a migration for changes to Source model
ahankinson Jun 6, 2024
914fbf3
Merge pull request #1512 from DDMAL/fixed-1511-add-missing-migration
lucasmarchd01 Jun 6, 2024
bea8ded
Fixed: Add institution models
ahankinson Jun 6, 2024
49146a3
Merge branch 'develop' into fixed-1505-institutions
ahankinson Jun 6, 2024
f9c0994
Fixed: Break up admin.py
ahankinson Jun 6, 2024
ae46096
Merge branch 'fixed-1510-admin' into fixed-1505-institutions
ahankinson Jun 6, 2024
4462359
Fixed: Add institutions to the new admin layout
ahankinson Jun 6, 2024
4546291
cantusindex: fix TypeError in get_suggested_chant
lucasmarchd01 Jun 7, 2024
6638001
Merge pull request #1517 from lucasmarchd01/issue-1515
lucasmarchd01 Jun 7, 2024
5bc4114
Merge pull request #1513 from DDMAL/fixed-1510-admin
dchiller Jun 11, 2024
e3a6279
refactor(nginx): Consolidate static files for custom error pages
dchiller Jun 11, 2024
b11f202
feat(nginx): Add custom 500 error page
dchiller Jun 11, 2024
62f418b
build(nginx): Add nginx password file
dchiller Jun 11, 2024
76ee930
style(nginx): Add missing space to cantusdb.conf.development
dchiller Jun 11, 2024
75cf156
Fixed: Expand institution model
ahankinson Jun 11, 2024
98b9c58
Merge branch 'develop' into fixed-1505-institutions
ahankinson Jun 11, 2024
efae0ea
Merge pull request #1520 from dchiller/nginx-password-and-error-page
dchiller Jun 11, 2024
5d9998b
Add former sigla to institution records
ahankinson Jun 11, 2024
7734cde
Comment out chant segment and BD-specific fields on chant forms
dchiller Jun 12, 2024
2050973
Merge pull request #1522 from dchiller/i1521-remove-segment-from-chan…
dchiller Jun 12, 2024
4ac2d91
Enhance the display of the institution identifiers
ahankinson Jun 12, 2024
1d961f6
build: use specific version of psycopg-binary package
dchiller Jun 12, 2024
3c270d8
fix: Account for bad alignment flag in EditSyllabificationView
dchiller Jun 12, 2024
226cb5b
feat: Add github actions for django tests
dchiller Jun 12, 2024
5605ba6
Adjust string formatting
ahankinson Jun 13, 2024
2d213fd
Merge branch 'develop' into fixed-1505-institutions
ahankinson Jun 13, 2024
4c92016
Merge pull request #1514 from DDMAL/fixed-1505-institutions
dchiller Jun 13, 2024
6266757
Merge pull request #1526 from dchiller/add-test-runner
dchiller Jun 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions config/nginx/conf.d/cantusdb.conf.development
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,9 @@ server {
alias /resources/api_cache/concordances.json;
expires modified +24h;
}

location = /style.css {
root /;
}
location = /background.jpg {
root /;
}
location = /CantusLogoSmall.gif {
root /;
}
location = /favicon.ico {

error_page 500 /500.html;
location = /500.html {
root /;
}

Expand All @@ -45,4 +37,4 @@ server {
location = /504.html {
root /;
}
}
}
2 changes: 1 addition & 1 deletion cron/management/manage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
DOCKER_COMPOSE_FILE=$1 # This is the path to the docker-compose file.
COMMAND=$2 # This is the command to execute.

/usr/local/bin/docker compose -f $DOCKER_COMPOSE_FILE exec -T django python manage.py $COMMAND
/usr/bin/docker compose -f $DOCKER_COMPOSE_FILE exec -T django python manage.py $COMMAND
9 changes: 6 additions & 3 deletions django/cantusdb_project/cantusindex.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,12 @@ def get_suggested_chant(
# mostly, in case of a timeout within get_json_from_ci_api
return None

fulltext: str = json["info"]["field_full_text"]
incipit: str = " ".join(fulltext.split(" ")[:5])
genre_name: str = json["info"]["field_genre"]
try:
fulltext: str = json["info"]["field_full_text"]
incipit: str = " ".join(fulltext.split(" ")[:5])
genre_name: str = json["info"]["field_genre"]
except TypeError:
return None
genre_id: Optional[int] = None
try:
genre_id = Genre.objects.get(name=genre_name).id
Expand Down
236 changes: 0 additions & 236 deletions django/cantusdb_project/main_app/admin.py

This file was deleted.

12 changes: 12 additions & 0 deletions django/cantusdb_project/main_app/admin/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from main_app.admin.century import CenturyAdmin
from main_app.admin.chant import ChantAdmin
from main_app.admin.differentia import DifferentiaAdmin
from main_app.admin.feast import FeastAdmin
from main_app.admin.genre import GenreAdmin
from main_app.admin.notation import NotationAdmin
from main_app.admin.office import OfficeAdmin
from main_app.admin.provenance import ProvenanceAdmin
from main_app.admin.rism_siglum import RismSiglumAdmin
from main_app.admin.segment import SegmentAdmin
from main_app.admin.sequence import SequenceAdmin
from main_app.admin.source import SourceAdmin
27 changes: 27 additions & 0 deletions django/cantusdb_project/main_app/admin/base_admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from reversion.admin import VersionAdmin


# these fields should not be editable by all classes
EXCLUDE = ("json_info",)


READ_ONLY = (
"created_by",
"last_updated_by",
"date_created",
"date_updated",
)


class BaseModelAdmin(VersionAdmin):
exclude = EXCLUDE
readonly_fields = READ_ONLY

# if an object is created in the admin interface, assign the user to the created_by field
# else if an object is updated in the admin interface, assign the user to the last_updated_by field
def save_model(self, request, obj, form, change):
if change:
obj.last_updated_by = request.user
else:
obj.created_by = request.user
super().save_model(request, obj, form, change)
11 changes: 11 additions & 0 deletions django/cantusdb_project/main_app/admin/century.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from django.contrib import admin

from main_app.admin.base_admin import BaseModelAdmin
from main_app.forms import AdminCenturyForm
from main_app.models import Century


@admin.register(Century)
class CenturyAdmin(BaseModelAdmin):
search_fields = ("name",)
form = AdminCenturyForm
53 changes: 53 additions & 0 deletions django/cantusdb_project/main_app/admin/chant.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
from django.contrib import admin

from main_app.admin.base_admin import EXCLUDE, READ_ONLY, BaseModelAdmin
from main_app.forms import AdminChantForm
from main_app.models import Chant


@admin.register(Chant)
class ChantAdmin(BaseModelAdmin):

@admin.display(description="Source Siglum")
def get_source_siglum(self, obj):
if obj.source:
return obj.source.siglum

list_display = (
"incipit",
"get_source_siglum",
"genre",
)
search_fields = (
"title",
"incipit",
"cantus_id",
"id",
)

readonly_fields = READ_ONLY + ("incipit",)

list_filter = (
"genre",
"office",
)
exclude = EXCLUDE + (
"col1",
"col2",
"col3",
"next_chant",
"s_sequence",
"is_last_chant_in_feast",
"visible_status",
"date",
"volpiano_notes",
"volpiano_intervals",
"title",
"differentiae_database",
)
form = AdminChantForm
raw_id_fields = (
"source",
"feast",
)
ordering = ("source__siglum",)
Loading