2024-10-09 19:54:31 +00:00
|
|
|
from notfellchen.celery import app as celery_app
|
2024-10-10 15:07:11 +00:00
|
|
|
from .tools.admin import clean_locations, deactivate_unchecked_adoption_notices
|
2024-10-10 16:35:22 +00:00
|
|
|
from .tools.misc import healthcheck_ok
|
2024-10-10 05:39:44 +00:00
|
|
|
from .models import Location, AdoptionNotice
|
|
|
|
|
2024-10-09 19:54:31 +00:00
|
|
|
|
|
|
|
@celery_app.task(name="admin.clean_locations")
|
|
|
|
def task_clean_locations():
|
|
|
|
clean_locations()
|
2024-10-10 05:39:44 +00:00
|
|
|
|
|
|
|
|
2024-10-10 15:07:11 +00:00
|
|
|
@celery_app.task(name="admin.deactivate_unchecked")
|
|
|
|
def task_deactivate_unchecked():
|
|
|
|
deactivate_unchecked_adoption_notices()
|
|
|
|
|
|
|
|
|
2024-10-10 05:39:44 +00:00
|
|
|
@celery_app.task(name="commit.add_location")
|
|
|
|
def add_adoption_notice_location(pk):
|
|
|
|
instance = AdoptionNotice.objects.get(pk=pk)
|
|
|
|
Location.add_location_to_object(instance)
|
2024-10-10 16:35:22 +00:00
|
|
|
|
|
|
|
@celery_app.task(name="tools.healthcheck")
|
|
|
|
def task_healthcheck():
|
|
|
|
healthcheck_ok()
|