Notfellchen/src/fellchensammlung/tasks.py

20 lines
584 B
Python
Raw Normal View History

2024-10-09 19:54:31 +00:00
from notfellchen.celery import app as celery_app
from .tools.admin import clean_locations, deactivate_unchecked_adoption_notices
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
@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)