Skip to content

Commit

Permalink
Change app import for Django 4
Browse files Browse the repository at this point in the history
Django 4.1 deprecated the default_app_config option that was used
previously to install the cantusdata app. This app is now installed using
a dotted path in the settings.py file.

Django 4.1 also added a new positional argument to post_delete signals,
which is added with this commit.
  • Loading branch information
dchiller committed Jun 26, 2023
1 parent 2bace57 commit 0f8c37d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 0 additions & 2 deletions app/public/cantusdata/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
from django.db.models.signals import post_migrate
from .celery import app as celery_app

default_app_config = "cantusdata.CantusdataConfig"


class CantusdataConfig(AppConfig):
name = "cantusdata"
Expand Down
2 changes: 1 addition & 1 deletion app/public/cantusdata/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"django_celery_results",
"rest_framework",
"rest_framework.authtoken",
"cantusdata",
"cantusdata.CantusdataConfig",
"django_extensions",
"coverage",
)
Expand Down
4 changes: 2 additions & 2 deletions app/public/cantusdata/signals/solr_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def folio_or_manuscript_saved(self, sender, instance, created, **kwargs):
with self.get_session() as sess:
sess.schedule_update(instance, is_new=created)

def folio_or_manuscript_deleted(self, sender, instance, **kwargs):
def folio_or_manuscript_deleted(self, sender, instance, using, **kwargs):
with self.get_session() as sess:
sess.schedule_deletion(instance)

Expand All @@ -81,7 +81,7 @@ def chant_saved(self, sender, instance, created, **kwargs):
sess.schedule_update(instance.folio)
sess.schedule_update(instance.manuscript)

def chant_deleted(self, sender, instance, **kwargs):
def chant_deleted(self, sender, instance, using, **kwargs):
with self.get_session() as sess:
sess.schedule_deletion(instance)
sess.schedule_update(instance.folio)
Expand Down

0 comments on commit 0f8c37d

Please sign in to comment.