From 4504a18f606fc645626c182127c9d597848a66ce Mon Sep 17 00:00:00 2001 From: moanos Date: Thu, 10 Oct 2024 17:07:11 +0200 Subject: [PATCH] feat: add celery task to deactivate unchecked --- src/fellchensammlung/tasks.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/fellchensammlung/tasks.py b/src/fellchensammlung/tasks.py index 05d6d51..969c318 100644 --- a/src/fellchensammlung/tasks.py +++ b/src/fellchensammlung/tasks.py @@ -1,5 +1,5 @@ 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 @@ -8,8 +8,12 @@ def task_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") def add_adoption_notice_location(pk): instance = AdoptionNotice.objects.get(pk=pk) Location.add_location_to_object(instance) -