feat: add celery task to deactivate unchecked

This commit is contained in:
moanos [he/him] 2024-10-10 17:07:11 +02:00
parent df41028e99
commit 4504a18f60

View File

@ -1,5 +1,5 @@
from notfellchen.celery import app as celery_app from notfellchen.celery import app as celery_app
from .tools.admin import clean_locations from .tools.admin import clean_locations, deactivate_unchecked_adoption_notices
from .models import Location, AdoptionNotice from .models import Location, AdoptionNotice
@ -8,8 +8,12 @@ def task_clean_locations():
clean_locations() clean_locations()
@celery_app.task(name="admin.deactivate_unchecked")
def task_deactivate_unchecked():
deactivate_unchecked_adoption_notices()
@celery_app.task(name="commit.add_location") @celery_app.task(name="commit.add_location")
def add_adoption_notice_location(pk): def add_adoption_notice_location(pk):
instance = AdoptionNotice.objects.get(pk=pk) instance = AdoptionNotice.objects.get(pk=pk)
Location.add_location_to_object(instance) Location.add_location_to_object(instance)