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 staging into production, 14 Aug 2024 #1601

Merged
merged 247 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
247 commits
Select commit Hold shift + click to select a range
8aac174
management: add atomic transation to populate diff_id fields
lucasmarchd01 Jun 5, 2024
ae31659
management: include iterator for chant queryset
lucasmarchd01 Jun 5, 2024
6e26435
Fixed: Adjust base template
ahankinson Jun 17, 2024
01a1dea
Fixed: Move titles and scripts to their own block
ahankinson Jun 17, 2024
d4a58e1
New: mark institutions as private collectors
ahankinson Jun 17, 2024
b47f9c4
New: Add shelfmark to sources
ahankinson Jun 17, 2024
a5b3bb2
New: Migration script
ahankinson Jun 17, 2024
113e3ef
New: Holding institution autocomplete
ahankinson Jun 17, 2024
a0fe49b
Fixed: Remove transitive import for LoginView
ahankinson Jun 17, 2024
067f72d
Fixed: Optimize user source lookups
ahankinson Jun 17, 2024
364a483
build(deps): bump urllib3 from 2.2.1 to 2.2.2
dependabot[bot] Jun 17, 2024
38cd053
The Great Feast Rework
ahankinson Jun 18, 2024
9db92f4
Rework Source Display
ahankinson Jun 18, 2024
ee785b3
New: Add a split string helper tag
ahankinson Jun 18, 2024
73d5df4
Add migrations
ahankinson Jun 18, 2024
1168e29
Change source title and siglum to optional
ahankinson Jun 18, 2024
8fa654d
Fixed: Remove siglum column
ahankinson Jun 18, 2024
8bfc344
Tests: Disable Feast Detail Tests
ahankinson Jun 19, 2024
c41b458
Fixed: Small style update
ahankinson Jun 19, 2024
f507cb5
Fixed: Wrong order of columns
ahankinson Jun 19, 2024
c5bd3f5
Fixed: Update source display in full inventory
ahankinson Jun 19, 2024
9f5203a
WIP: Updates to the tests
ahankinson Jun 19, 2024
85ba222
Merge branch 'develop' into mega-changes-source-rework
ahankinson Jun 19, 2024
0100edb
Update display of source info
ahankinson Jun 19, 2024
0fd2c43
Merge branch 'develop' into mega-changes-source-rework
ahankinson Jun 19, 2024
faa90ed
Fixed: Re-sync templates
ahankinson Jun 19, 2024
20ad63e
Fixed: A bug in how the chants were counted
ahankinson Jun 20, 2024
f6c0208
New: Add a list of sources attached to the institution
ahankinson Jun 20, 2024
92d1908
New: Private Collector Institutinos
ahankinson Jun 20, 2024
7ddd9d8
Fixed: Make sorting of notation page obvious
ahankinson Jun 20, 2024
5067266
Adjust sorting field for sources in sequences
ahankinson Jun 20, 2024
1086b2e
Update the migration script
ahankinson Jun 20, 2024
66d9363
Fixed: source list on the browse_chants field
ahankinson Jun 20, 2024
5dd9620
Fixed: Refactor chant view
ahankinson Jun 21, 2024
498f4f3
Clean up JavaScript
ahankinson Jun 21, 2024
621c6d1
New: Add input filter for admin pages
ahankinson Jun 21, 2024
f3142cb
Adjust source admin page
ahankinson Jun 21, 2024
d4a1bc7
Adjust Institution admin page
ahankinson Jun 21, 2024
3377657
Add new migration script
ahankinson Jun 21, 2024
70a2655
Add City to Institution record string representation
ahankinson Jun 21, 2024
8358c0d
Add "Private" if source is Private
ahankinson Jun 21, 2024
f6851e7
Fixed: Problematic block name
ahankinson Jun 21, 2024
80cd509
Minor fixes to ci_search page
ahankinson Jun 21, 2024
223510a
Fixes for displaying source headings
ahankinson Jun 21, 2024
8db8c6d
Use bootstrap classes in the global search bar
ahankinson Jun 21, 2024
bb318d6
Fixed: Ordering of chants by siglum
ahankinson Jun 21, 2024
bd84f82
Fixed: Adjust APIs for new source structure
ahankinson Jun 21, 2024
9335b85
Style: Order imports
ahankinson Jun 21, 2024
b05de97
Working tests
ahankinson Jun 21, 2024
07fc91a
Fixed: Chants
ahankinson Jun 21, 2024
058ac85
Re-order imports
ahankinson Jun 21, 2024
2ae4966
Fixed: headings as properties
ahankinson Jun 21, 2024
fc8bb43
Formatting in migration script
ahankinson Jun 21, 2024
b7398dc
Update old migration script
ahankinson Jun 21, 2024
699c10e
Fixed: Update source search
ahankinson Jun 21, 2024
5f85304
Fixed: rework feast detail tests
ahankinson Jun 21, 2024
4d4e4a9
fix(templates): Change links under Resources menu and add link to pro…
dchiller Jul 10, 2024
d7522a1
Merge pull request #1557 from dchiller/i1556-change-resources-links
dchiller Jul 10, 2024
fdfeacb
build(deps): bump django from 4.2.11 to 4.2.14
dependabot[bot] Jul 10, 2024
2dd7148
Merge branch 'develop' into mega-changes-source-rework
ahankinson Jul 13, 2024
f9ee743
Add merged migrations
dchiller Jul 14, 2024
b9c5d77
Format imports in urls.py
dchiller Jul 15, 2024
89f68d7
fix(chant create): escape special characters in suggested chant data
lucasmarchd01 Jul 15, 2024
2e3c429
Remove commented template code
ahankinson Jul 16, 2024
a174634
Fixed: String representation of Sources
ahankinson Jul 16, 2024
f0c6fa2
Fixed: Use holding institution siglum
ahankinson Jul 16, 2024
694e376
Fixed: Unnecessary select_related items
ahankinson Jul 16, 2024
adc2d1c
Merge pull request #1561 from lucasmarchd01/issue-1554
lucasmarchd01 Jul 16, 2024
6fd9d8c
feat(management): add command to reassign feast data and update chants
lucasmarchd01 Jul 16, 2024
8c24c2e
style(feast): remove comment
lucasmarchd01 Jul 16, 2024
68321f9
style(management): add comment
lucasmarchd01 Jul 16, 2024
ca66179
fix(management): reassign sequences
lucasmarchd01 Jul 16, 2024
ecf901c
Merge pull request #1545 from DDMAL/mega-changes-source-rework
dchiller Jul 16, 2024
12d2bee
Fixed: A follow-up to the source rework
ahankinson Jul 16, 2024
3955203
Optimize imports
ahankinson Jul 16, 2024
9d722ff
Remove siglum from sequence form
ahankinson Jul 17, 2024
f62481c
refactor(command): change feast mapping to a global variable
lucasmarchd01 Jul 17, 2024
a1ec9f7
Merge pull request #1564 from lucasmarchd01/issue-1560
lucasmarchd01 Jul 17, 2024
a1e2a93
Merge pull request #1565 from DDMAL/develop
dchiller Jul 17, 2024
4d363a2
docs(source): update help text for date field in source model
lucasmarchd01 Jul 17, 2024
400375d
style(black): black formatting changes
lucasmarchd01 Jul 17, 2024
d3094fb
Merge pull request #1566 from DDMAL/source-cleanup-followup
dchiller Jul 17, 2024
e0c6257
Fixed: Migrating alternate names
ahankinson Jul 18, 2024
6f6fd12
Fixed: Add Sweden to list of countries
ahankinson Jul 18, 2024
69f35df
Merge branch 'develop' into issue-1363
lucasmarchd01 Jul 18, 2024
94180b7
style(black): black formatting changes
lucasmarchd01 Jul 18, 2024
c57b86b
Merge pull request #1567 from lucasmarchd01/issue-1363
lucasmarchd01 Jul 18, 2024
13f8240
docs(acknowledgements): add logos for legacy organizations
lucasmarchd01 Jul 18, 2024
38ae240
Merge branch 'develop' into fixed-alt-names-migration
ahankinson Jul 18, 2024
1257e79
Merge pull request #1568 from DDMAL/fixed-alt-names-migration
dchiller Jul 18, 2024
b973659
Fixed: Make title and siglum read-only
ahankinson Jul 19, 2024
9ede1eb
Fixed: Attach an ID to the XX-NN siglum
ahankinson Jul 19, 2024
791f8b3
Merge pull request #1570 from DDMAL/further-fixes-institutions
dchiller Jul 22, 2024
fe2bf34
Merge pull request #1571 from DDMAL/develop
dchiller Jul 22, 2024
d2c2ed7
refactor(views): separate autocomplete views from views.views
dchiller Jul 16, 2024
0600305
refactor(views): move change_password view to views.auth
dchiller Jul 16, 2024
f677e76
refactor(views): move redirect views to views.redirect
dchiller Jul 16, 2024
ecd4f2a
refactor(views): create site_stats views
dchiller Jul 23, 2024
6847a84
refactor(views): move contact flatpage to views.contact
dchiller Jul 23, 2024
2094ec3
refactor(views): move api views to views.api
dchiller Jul 23, 2024
6ad61db
refactor(urls): change urls.py import strategy
dchiller Jul 23, 2024
ad35080
refactor(views): fix conflicts in views.api and views.redirects
dchiller Jul 23, 2024
46619d6
feat(chant detail): Display polyphony and function fields when existing
dchiller Jul 23, 2024
caffa0d
feat(chant detail): display Benedicamus Domino fields where available
dchiller Jul 24, 2024
dbd2975
refactor(chant detail): remove duplicate query by get_object
dchiller Jul 24, 2024
f709567
Merge pull request #1573 from dchiller/chant-detail-display-fields
dchiller Jul 24, 2024
7e905f1
docs(acknowledgements): invert CUA logo text
lucasmarchd01 Jul 24, 2024
8289abb
Merge pull request #1574 from lucasmarchd01/issue-1406
lucasmarchd01 Jul 24, 2024
c121369
refactor(permissions): move project_manager_check to permissions.py
dchiller Jul 24, 2024
c0202c4
refactor(chant detail): fix typo in differentiae database
lucasmarchd01 Jul 25, 2024
eac997b
style(black): black formatting changes
lucasmarchd01 Jul 25, 2024
77e26b9
docs(differentia): fix type in comment
lucasmarchd01 Jul 25, 2024
6995beb
Merge pull request #1575 from lucasmarchd01/issue-1371
lucasmarchd01 Jul 25, 2024
c447fb1
Merge pull request #1563 from dchiller/split-views-files
dchiller Jul 25, 2024
227c08b
feat(chant search): add indexing notes search functionality
lucasmarchd01 Jul 29, 2024
967f92c
feat(chant search): add indexing notes search functionality
lucasmarchd01 Jul 29, 2024
0d43fa6
Merge branch 'issue-843' of https://github.com/lucasmarchd01/CantusDB…
lucasmarchd01 Jul 29, 2024
f91934e
test(chant search): add tests for indexing notes search
lucasmarchd01 Jul 29, 2024
cbed5fe
feat(source model): add temporary segment field to source
dchiller Jul 29, 2024
b61c198
Merge pull request #1559 from DDMAL/dependabot/pip/django-4.2.14
dchiller Jul 29, 2024
65c83c2
Merge pull request #1543 from DDMAL/dependabot/pip/urllib3-2.2.2
dchiller Jul 29, 2024
da114cb
fix(docker-compose): Remove obsolete version line
dchiller Jul 29, 2024
02e275b
feat(browse sources): Add country and source columns to table
dchiller Jul 29, 2024
55e5903
Merge pull request #1578 from dchiller/i1569-browse-sources-table
dchiller Jul 30, 2024
0cf9be0
Merge pull request #1576 from lucasmarchd01/issue-843
lucasmarchd01 Jul 30, 2024
12f5202
fix(source forms): Show name without ID for segment field on source f…
dchiller Jul 30, 2024
449dd97
refactor(source edit view): remove duplicate object query
dchiller Jul 30, 2024
540cb3e
Merge pull request #1577 from dchiller/i1549-segment-field
dchiller Jul 30, 2024
671deea
build(deps): add django-extensions and werkzeug to dev dependencies
dchiller Aug 5, 2024
0f3257b
feat(dev server): user runserver_plus in docker-compose-development
dchiller Aug 5, 2024
fa4e8bf
build(deps): add types-requests dev dependency
dchiller Aug 5, 2024
de20954
feat(chant create): use fixed nextchants API for suggested chants fea…
dchiller Aug 6, 2024
b3f2fbd
feat(text functions): update test_functions for new suggested chants …
dchiller Aug 6, 2024
e7cdd79
fix(test_views): change expected number of suggested chants in Chant …
dchiller Aug 6, 2024
f0c1e4d
fix(gh action): add docker-compose-test-runner for github action djan…
dchiller Aug 6, 2024
e7b98cc
Merge branch 'develop' into issue-1368-3
lucasmarchd01 Aug 6, 2024
390cb57
fix(management): ensure Differentia is created if not found
lucasmarchd01 Aug 6, 2024
6d62fe9
refactor(services): update URLs, models, codebase, and admin pages to…
lucasmarchd01 Aug 7, 2024
f0e5ce6
Merge pull request #1580 from lucasmarchd01/issue-1368-3
lucasmarchd01 Aug 7, 2024
3e8f70c
Merge pull request #1579 from dchiller/optimize-suggested-chants
dchiller Aug 7, 2024
443f8ca
New: Add source key filter to chants
ahankinson Aug 8, 2024
4e1064e
New: Add views for institutions
ahankinson Aug 8, 2024
1889021
fix(redirects): add permanent=True to redirects
lucasmarchd01 Aug 8, 2024
9349505
Merge pull request #1582 from lucasmarchd01/issue-1581
lucasmarchd01 Aug 8, 2024
65f9d4f
Merge pull request #1584 from DDMAL/add-source-key-filter
dchiller Aug 8, 2024
40391a9
Merge branch 'develop' into add-institution-views
ahankinson Aug 9, 2024
fb455c6
Merge pull request #1586 from DDMAL/add-institution-views
dchiller Aug 9, 2024
09c5749
feat(templates): add sortable_header template tag
dchiller Aug 9, 2024
c36febf
feat(source list): add sorting by country and source columns
dchiller Aug 9, 2024
a206538
refactor(source list view): minor source list view refactoring
dchiller Aug 9, 2024
ee12c96
Merge pull request #1592 from dchiller/i1217-source-list-sortable-col…
dchiller Aug 13, 2024
0c687f5
fix(migrations): add missing migration file
lucasmarchd01 Aug 13, 2024
2803e64
style(black): black formatting changes
lucasmarchd01 Aug 13, 2024
5ae61a9
Merge pull request #1596 from lucasmarchd01/add-migration-28
lucasmarchd01 Aug 13, 2024
059face
Merge pull request #1595 from DDMAL/develop
dchiller Aug 13, 2024
d22db31
build(nginx): turn off proxy_intercept_errors for development environ…
lucasmarchd01 Aug 14, 2024
a3c8e0c
build(docker): switch to runserver_plus in devcontainer setup
lucasmarchd01 Aug 14, 2024
16ec9f3
fix(admin): fix FieldError on admin user change page
lucasmarchd01 Aug 14, 2024
9718dff
Merge pull request #1599 from lucasmarchd01/nginx-config-devcontainer
lucasmarchd01 Aug 14, 2024
5710e23
Merge pull request #1600 from lucasmarchd01/issue-1597
lucasmarchd01 Aug 14, 2024
f5ff4f9
refactor(source edit): change help text for date field
lucasmarchd01 Aug 15, 2024
18b8088
Merge pull request #1603 from lucasmarchd01/issue-1602
lucasmarchd01 Aug 15, 2024
0ec23bb
feat(source list): add country filter to source list page
lucasmarchd01 Aug 19, 2024
ec8a851
fix(source): fix TypeError on source create page
lucasmarchd01 Aug 19, 2024
c49eb51
fix(source): fix TypeError on source create page
lucasmarchd01 Aug 19, 2024
7a714b0
Merge branch 'issue-1604' of https://github.com/lucasmarchd01/CantusD…
lucasmarchd01 Aug 19, 2024
1645e51
Merge pull request #1605 from lucasmarchd01/issue-1583
lucasmarchd01 Aug 19, 2024
f1265f3
feat(views): add JSONResponseMixin
dchiller Aug 21, 2024
db56be7
feat(genre and service views): add JSONResponseMixin to Genre and Ser…
dchiller Aug 21, 2024
ce71776
feat(backups): create weekly partial backup for RISM
dchiller Aug 21, 2024
aa34f09
New: add fields to models
ahankinson Aug 23, 2024
e6603a1
Update admin pages for institution and source
ahankinson Aug 23, 2024
c74546d
Update the "migrate_record" script
ahankinson Aug 23, 2024
5e72103
fix(source): make holding institution and shelfmark fields required
lucasmarchd01 Aug 23, 2024
c7f760c
fix(source): change templates to include required fields
lucasmarchd01 Aug 23, 2024
86d22c5
test(source): fix failing tests in SourceEditViewTest and SourceCreat…
lucasmarchd01 Aug 23, 2024
17aea26
Merge pull request #1614 from dchiller/i1587-rism-backup
dchiller Aug 26, 2024
af1efbb
Merge pull request #1615 from DDMAL/institution-fixes
dchiller Aug 26, 2024
ec7ac99
Merge branch 'develop' into issue-1604
lucasmarchd01 Aug 26, 2024
13b6c74
Merge pull request #1612 from dchiller/i1609-genre-office-endpoints
dchiller Aug 26, 2024
ba0ff80
fix(source list template): adjust source id columns
dchiller Aug 26, 2024
5776ecf
test(source list): add tests for source list ordering
dchiller Aug 26, 2024
398311a
build(dev dependencies): update faker version
dchiller Aug 26, 2024
8833cb8
refactor(tests): split tests/views.py
dchiller Aug 26, 2024
2c2ee59
fix(actions): add zoom links to link checker excludes
dchiller Aug 27, 2024
2366eec
feat(chant detail): show chant project when it exists
dchiller Aug 28, 2024
8691030
fix(chant detail): select_related on project relationship
dchiller Aug 28, 2024
c69f53a
new: add migration script for non-nullable fields
lucasmarchd01 Aug 30, 2024
d39d486
style: black formatting changes
lucasmarchd01 Aug 30, 2024
0ebf761
Merge pull request #1619 from dchiller/i1613-breakup-test-views
dchiller Aug 30, 2024
eed477f
Revert "Break up `test_views.py` so structure matches views directory"
dchiller Aug 30, 2024
32874b5
Merge pull request #1624 from DDMAL/revert-1619-i1613-breakup-test-views
dchiller Aug 30, 2024
22a048d
Merge pull request #1618 from dchiller/i1616-source-list-table
dchiller Aug 30, 2024
8dd5e3c
Merge pull request #1620 from dchiller/i1617-link-checker-fix
dchiller Aug 30, 2024
c3f78ae
Merge pull request #1621 from dchiller/i1594-display-chant-project
dchiller Aug 30, 2024
28657a2
Merge pull request #1606 from lucasmarchd01/issue-1604
lucasmarchd01 Aug 30, 2024
0198f39
refactor(tests): split tests/views.py
dchiller Aug 26, 2024
f3931bb
fix: delete original test_views.py
dchiller Sep 2, 2024
8d785c2
Merge pull request #1625 from dchiller/i1613-breakup-test-views
dchiller Sep 3, 2024
1e4c4cd
Merge pull request #1622 from DDMAL/develop
dchiller Sep 3, 2024
329d8f4
Fixed: Add name field to source models
ahankinson Sep 13, 2024
61a2d31
New: Add Source Identifier field
ahankinson Sep 13, 2024
fe72a2f
Fixed: Change "Private" to "Cantus"
ahankinson Sep 13, 2024
d0f7bf5
Fixed: Ensure the source identifiers are searchable in the admin UI
ahankinson Sep 13, 2024
b407110
Fixed: Adjust display fields
ahankinson Sep 13, 2024
4532cfd
Merge pull request #1629 from DDMAL/institution-source-changes
dchiller Sep 17, 2024
bf5c984
fix: maintain compatibility in external/export APIs
dchiller Oct 1, 2024
3265dbd
fix(ms073): temporarily turn off volpiano display
dchiller Oct 2, 2024
19a0828
feat(source ids): add command to fix dact_id and fragmentarium_id for…
dchiller Oct 3, 2024
d10152e
refactor(tests): refactor test_views.test_chant.ChantCreateViewTest
dchiller Oct 3, 2024
34c130f
refactor(tests): fix lint errors in test_chant.py
dchiller Oct 3, 2024
3907d42
refactor(chant create view): reduce duplicate queries and tests
dchiller Oct 3, 2024
6308058
fix(source melody search): remove error from "source" queryset
dchiller Oct 2, 2024
9282e98
Merge pull request #1643 from dchiller/i1641-fix-external-api-compata…
dchiller Oct 4, 2024
bcfac9b
Merge pull request #1651 from dchiller/i1644-clean-frag-and-dact-ids
dchiller Oct 4, 2024
cc14cf5
Merge pull request #1649 from dchiller/i1635-no-ms73-volpiano
dchiller Oct 4, 2024
192a164
feat(chant views): catch invalid text errors
dchiller Oct 4, 2024
ff92465
feat(source model): add source_completeness and production_method fields
dchiller Oct 2, 2024
2a272c8
refactor(forms): create StyledChoiceField on forms
dchiller Oct 2, 2024
f646e77
feat(source name): add source name to create, edit, and detail pages
dchiller Oct 2, 2024
d97563c
fix(source): make holding_institution optional for sources
dchiller Oct 2, 2024
065ef07
chore: add migrations for previous commits
dchiller Oct 2, 2024
15fcf5b
fix(source admin form): order institutions by city then name
dchiller Oct 7, 2024
20eba46
fix(source display): format colloquial name and "(fragment)"
dchiller Oct 7, 2024
8eb3df8
fix(source header): use Cantus prefix if no institution siglum
dchiller Oct 7, 2024
7a3eeea
fix(api): optimize json-cid view queries
dchiller Oct 8, 2024
a23f6f8
fix(remap_user_ids): optimize chant iteration and include revision
dchiller Oct 10, 2024
54a54bf
feat(commands): add cantus id mapping command
dchiller Oct 10, 2024
1dfe503
Merge pull request #1645 from dchiller/i1628-source-printed
dchiller Oct 11, 2024
f01050a
Merge pull request #1656 from dchiller/i1655-optimize-json-cid
dchiller Oct 11, 2024
a638402
Merge branch 'develop' into handle-latin-errors
dchiller Oct 11, 2024
8f70f12
Merge pull request #1662 from dchiller/i1661-cantus-id-mapping
dchiller Oct 11, 2024
97a13c6
Merge pull request #1653 from dchiller/handle-latin-errors
dchiller Oct 11, 2024
8ca73e2
Merge pull request #1663 from DDMAL/develop
dchiller Oct 11, 2024
4ab7478
fix(sources): modify source_completeness and complete_inventory display
dchiller Oct 15, 2024
9d63616
fix(populate_source_completeness): map full_source = None to source_c…
dchiller Oct 15, 2024
7561b0e
fix(source list view): use source_completeness field to filter source…
dchiller Oct 15, 2024
b003278
fix(migrations): add migrations for adjusted source_completeness options
dchiller Oct 15, 2024
55162dd
fix(source admin): remove custom `full_source` field
dchiller Oct 15, 2024
a167fc7
refactor(forms): define complete_inventory choices once in forms.py
dchiller Oct 15, 2024
a2f9875
fix(command): add Norway to migrate_records countries
dchiller Oct 15, 2024
81f3c09
fix(institutions): Show `[No City]` if no institution city
dchiller Oct 15, 2024
147c0f4
fix(institution detail): show colloquial name if exists
dchiller Oct 15, 2024
6d3071d
fix(century display): display all source centuries
dchiller Oct 18, 2024
ff69093
Merge pull request #1666 from dchiller/i1665-source-completeness-fix
dchiller Oct 18, 2024
b47ecba
Merge pull request #1669 from dchiller/century-date-display
dchiller Oct 18, 2024
9a15871
Merge pull request #1671 from DDMAL/develop
dchiller Oct 18, 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
2 changes: 1 addition & 1 deletion .github/workflows/broken-link-checker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
id: lychee
uses: lycheeverse/[email protected]
with:
args: --exclude http:\/\/cantus\.sk.* ${{ matrix.links }}
args: --exclude http:\/\/cantus\.sk.* --exclude https:\/\/us06web\.zoom\.us* ${{ matrix.links }}
format: json
output: /tmp/link-checker-output.txt
- name: Curating Link Checker Output
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/django_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ jobs:
envkey_AWS_EMAIL_HOST_PASSWORD: test_password
directory: config/envs
file_name: dev_env
- run: docker compose -f docker-compose-development.yml build
- run: docker compose -f docker-compose-development.yml up -d
- run: docker compose -f docker-compose-development.yml exec -T django python manage.py test main_app.tests
- run: docker compose -f docker-compose-test-runner.yml build
- run: docker compose -f docker-compose-test-runner.yml up -d
- run: docker compose -f docker-compose-test-runner.yml exec -T django python manage.py test main_app.tests
2 changes: 1 addition & 1 deletion config/nginx/conf.d/cantusdb.conf.development
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ server {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_redirect off;
proxy_intercept_errors on;
proxy_intercept_errors off;
}

location /static {
Expand Down
6 changes: 5 additions & 1 deletion cron/postgres/db_backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ BACKUP_FILENAME=$(date "+%Y-%m-%dT%H:%M:%S").sql.gz # This is th


# Create the backup and copy it to the daily backup directory
mkdir -p $BACKUP_DIR/daily $BACKUP_DIR/weekly $BACKUP_DIR/monthly $BACKUP_DIR/yearly
mkdir -p $BACKUP_DIR/daily $BACKUP_DIR/weekly $BACKUP_DIR/monthly $BACKUP_DIR/yearly $BACKUP_DIR/rism
/usr/bin/docker exec cantusdb-postgres-1 /usr/local/bin/postgres_backup.sh $BACKUP_FILENAME
/usr/bin/docker cp cantusdb-postgres-1:/var/lib/postgresql/backups/$BACKUP_FILENAME $BACKUP_DIR/daily
/usr/bin/docker exec cantusdb-postgres-1 rm /var/lib/postgresql/backups/$BACKUP_FILENAME
Expand All @@ -34,10 +34,14 @@ MONTH_OF_YEAR=$(date "+%m")

# Retain weekly backups on Mondays
# Manage retention of weekly backups
# Copy the partial export for RISM purposes (created weekly on Mondays)
if [ $DAY_OF_WEEK -eq 1 ]; then
cp $BACKUP_DIR/daily/$BACKUP_FILENAME $BACKUP_DIR/weekly
FILES_TO_REMOVE=$(ls -td $BACKUP_DIR/weekly/* | tail -n +9)
[[ ! -z "$FILES_TO_REMOVE" ]] && rm $FILES_TO_REMOVE
# Copy the partial DB backup for RISM purposes to $BACKUP_DIR/rism
/usr/bin/docker cp cantusdb-postgres-1:/var/lib/postgresql/backups/cantusdb_rism_export.sql.gz $BACKUP_DIR/rism
/usr/bin/docker exec cantusdb-postgres-1 rm /var/lib/postgresql/backups/cantusdb_rism_export.sql.gz
fi

# Retain a monthly backup on the first day of the month
Expand Down
1 change: 1 addition & 0 deletions django/cantusdb_project/cantusdb/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,5 +208,6 @@

if DEBUG:
INSTALLED_APPS.append("debug_toolbar")
INSTALLED_APPS.append("django_extensions")
# debug toolbar must be inserted as early in the middleware as possible
MIDDLEWARE.insert(0, "debug_toolbar.middleware.DebugToolbarMiddleware")
179 changes: 85 additions & 94 deletions django/cantusdb_project/cantusindex.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,131 +3,117 @@
Cantus Index's (CI's) various APIs.
"""

import requests
from typing import Optional, Union, Callable
from main_app.models import Genre
import json
from typing import Optional, Union, Callable, TypedDict, Any

import requests
from requests.exceptions import SSLError, Timeout, HTTPError

from main_app.models import Genre

CANTUS_INDEX_DOMAIN: str = "https://cantusindex.uwaterloo.ca"
OLD_CANTUS_INDEX_DOMAIN: str = "https://cantusindex.org"
DEFAULT_TIMEOUT: float = 2 # seconds
NUMBER_OF_SUGGESTED_CHANTS: int = 3 # this number can't be too large,
# since for each suggested chant, we make a request to Cantus Index.
# We haven't yet parallelized this process, so setting this number
# too high will cause the Chant Create page to take a very long time
# to load. If/when we parallelize this process, we want to limit
# the size of the burst of requests sent to CantusIndex.
NUMBER_OF_SUGGESTED_CHANTS: int = 5 # default number of suggested chants to return
# with the get_suggested_chants function


class SuggestedChant(TypedDict):
"""
Dictionary containing information required for
the suggested chants feature on the Chant Create form.
"""

cantus_id: str
occurrences: int
fulltext: Optional[str]
genre_name: Optional[str]
genre_id: Optional[int]


def get_suggested_chants(
cantus_id: str, number_of_suggestions: int = NUMBER_OF_SUGGESTED_CHANTS
) -> Optional[list[dict]]:
) -> Optional[list[SuggestedChant]]:
"""
Given a Cantus ID, query Cantus Index's /nextchants API for a list of
Cantus IDs that follow the given Cantus ID in existing manuscripts.
Sort the list by the number of occurrences of each Cantus ID, and return
a list of dictionaries containing information about the suggested Cantus IDs
with the highest number of occurrences.

Args:
cantus_id (str): a Cantus ID
number_of_suggestions (int): the number of suggested Cantus IDs to return

Returns:
Optional[list[dict]]: A list of dictionaries, each containing information
about a suggested Cantus ID:
- "cantus_id": the suggested Cantus ID
- "occurrences": the number of times the suggested Cantus ID follows
the given Cantus ID in existing manuscripts
- "fulltext": the full text of the suggested Cantus ID
- "genre_name": the genre of the suggested Cantus ID
- "genre_id": the ID of the genre of the suggested Cantus ID
If no suggestions are available, returns None.
"""
endpoint_path: str = f"/json-nextchants/{cantus_id}"
all_suggestions: Union[list, dict, None] = get_json_from_ci_api(endpoint_path)
all_suggestions = get_json_from_ci_api(endpoint_path)

if not isinstance(all_suggestions, list):
# get_json_from_ci_api timed out
# or CI returned a response with no suggestions.
if all_suggestions is None:
return None

# when Cantus ID doesn't exist within CI, CI's api returns a 200 response with `['Cantus ID is not valid']`
# when Cantus ID doesn't exist within CI, CI's api returns a
# 200 response with `['Cantus ID is not valid']`
first_suggestion = all_suggestions[0]
if not isinstance(first_suggestion, dict):
return None

sort_by_occurrences: Callable[[dict], int] = lambda suggestion: int(
sort_by_occurrences: Callable[[dict[Any, Any]], int] = lambda suggestion: int(
suggestion["count"]
)
sorted_suggestions: list = sorted(
sorted_suggestions: list[dict[Any, Any]] = sorted(
all_suggestions, key=sort_by_occurrences, reverse=True
)
trimmed_suggestions: list = sorted_suggestions[:number_of_suggestions]
trimmed_suggestions = sorted_suggestions[:number_of_suggestions]

suggested_chants: list[Optional[dict]] = []
suggested_chants: list[SuggestedChant] = []
for suggestion in trimmed_suggestions:
cantus_id: str = suggestion["cid"]
occurrences: int = int(suggestion["count"])
suggested_chants.append(get_suggested_chant(cantus_id, occurrences))

# filter out Cantus IDs where get_suggested_chant timed out
filtered_suggestions: list[dict] = [
sugg for sugg in suggested_chants if sugg is not None
]

return filtered_suggestions


def get_suggested_chant(
cantus_id: str, occurrences: int, timeout: float = DEFAULT_TIMEOUT
) -> Optional[dict]:
"""Given a Cantus ID and a number of occurrences, query one of Cantus Index's
APIs for information on that Cantus ID and return a dictionary
containing a full text, an incipit, the ID of that Cantus ID's genre, and
the number of occurrences for that Cantus ID

(Number of occurrences: this function is used on the Chant Create page,
to suggest Cantus IDs of chants that might follow a chant with the Cantus ID
of the most recently created chant within the current source. Number of occurrences
is provided by Cantus Index's /nextchants API, based on which chants follow which
other chants in existing manuscripts)

Args:
cantus_id (str): a Cantus ID
occurrences (int): the number of times chants with this Cantus ID follow chants
with the Cantus ID of the most recently created chant.

Returns:
Optional[dict]: A dictionary with the following keys:
- "cantus_id"
- "occurrences"
- "fulltext"
- "incipit"
- "genre_id"
...but if get_json_from_ci_api timed out, returns None instead
"""
endpoint_path: str = f"/json-cid/{cantus_id}"
json: Union[dict, list, None] = get_json_from_ci_api(endpoint_path, timeout=timeout)

if not isinstance(json, dict):
# mostly, in case of a timeout within get_json_from_ci_api
return None
sugg_cantus_id = suggestion["cid"]
occurences = int(suggestion["count"])
suggestion_info = suggestion.get("info")
if suggestion_info:
fulltext = suggestion_info.get("field_full_text")
genre_name = suggestion_info.get("field_genre")
else:
fulltext = None
genre_name = None
try:
genre_id = Genre.objects.get(name=genre_name).id
except Genre.DoesNotExist:
genre_id = None
suggested_chants.append(
{
"cantus_id": sugg_cantus_id,
"occurrences": occurences,
"fulltext": fulltext,
"genre_name": genre_name,
"genre_id": genre_id,
}
)

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
except Genre.DoesNotExist:
pass

clean_cantus_id = cantus_id.replace(".", "d").replace(":", "c")
# "d"ot "c"olon
return {
"cantus_id": cantus_id,
"occurrences": occurrences,
"fulltext": fulltext,
"incipit": incipit,
"genre_name": genre_name,
"genre_id": genre_id,
"clean_cantus_id": clean_cantus_id,
}
return suggested_chants


def get_suggested_fulltext(cantus_id: str) -> Optional[str]:
endpoint_path: str = f"/json-cid/{cantus_id}"
json: Union[dict, list, None] = get_json_from_ci_api(endpoint_path)
json_response: Union[dict, list, None] = get_json_from_ci_api(endpoint_path)

if not isinstance(json, dict):
if not isinstance(json_response, dict):
# mostly, in case of a timeout within get_json_from_ci_api
return None

try:
suggested_fulltext = json["info"]["field_full_text"]
suggested_fulltext = json_response["info"]["field_full_text"]
except KeyError:
return None

Expand Down Expand Up @@ -205,7 +191,7 @@ def get_ci_text_search(search_term: str) -> Optional[list[Optional[dict]]]:

def get_json_from_ci_api(
path: str, timeout: float = DEFAULT_TIMEOUT
) -> Union[dict, list, None]:
) -> Union[dict[Any, Any], list[Any], None]:
"""Given a path, send a request to Cantus Index at that path,
decode the response to remove its Byte Order Marker, parse it,
and return it as a dictionary or list.
Expand All @@ -219,7 +205,7 @@ def get_json_from_ci_api(
Union[dict, list, None]:
If the JSON returned from Cantus Index is a JSON object, returns a dict.
If the JSON returned is a JSON array, returns a list.
In case the request times out, returns None.
If the request times out, or other types are returned, returns None.
"""

if not path.startswith("/"):
Expand All @@ -241,4 +227,9 @@ def get_json_from_ci_api(
# there are no suggested chants
return None

return response.json()
parsed_response = response.json()

if not isinstance(parsed_response, (dict, list)):
return None

return parsed_response
2 changes: 1 addition & 1 deletion django/cantusdb_project/main_app/admin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
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.service import ServiceAdmin
from main_app.admin.provenance import ProvenanceAdmin
from main_app.admin.segment import SegmentAdmin
from main_app.admin.sequence import SequenceAdmin
Expand Down
25 changes: 22 additions & 3 deletions django/cantusdb_project/main_app/admin/chant.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,34 @@
from django.contrib import admin

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


class SourceKeyFilter(InputFilter):
parameter_name = "source_id"
title = "Source ID"

def queryset(self, request, queryset):
if self.value():
return queryset.filter(source_id=self.value())


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

def get_queryset(self, request):
return (
super()
.get_queryset(request)
.select_related("source__holding_institution", "genre", "service")
)

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

list_display = (
"incipit",
Expand All @@ -23,13 +40,15 @@ def get_source_siglum(self, obj):
"incipit",
"cantus_id",
"id",
"source__holding_institution__siglum",
)

readonly_fields = READ_ONLY + ("incipit",)

list_filter = (
SourceKeyFilter,
"genre",
"office",
"service",
)
exclude = EXCLUDE + (
"col1",
Expand All @@ -50,4 +69,4 @@ def get_source_siglum(self, obj):
"source",
"feast",
)
ordering = ("source__siglum",)
ordering = ("source__holding_institution__siglum", "source__shelfmark")
17 changes: 17 additions & 0 deletions django/cantusdb_project/main_app/admin/filters.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from django.contrib.admin import SimpleListFilter


class InputFilter(SimpleListFilter):
template = "admin/input_filter.html"

def lookups(self, request, model_admin):
return ((),)

def choices(self, changelist):
all_choice = next(super().choices(changelist))
all_choice["query_parts"] = (
(key, value)
for key, value in changelist.get_filters_params().items()
if key != self.parameter_name
)
yield all_choice
Loading
Loading