From 0e4e53141453fefb57516ee784aacf801e254acf Mon Sep 17 00:00:00 2001 From: moanos Date: Sat, 14 Dec 2024 09:32:37 +0100 Subject: [PATCH] feat: Add 404 deactivation to instance health check --- .../fellchensammlung/instance-health-check.html | 10 +++++++++- src/fellchensammlung/views.py | 5 ++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/fellchensammlung/templates/fellchensammlung/instance-health-check.html b/src/fellchensammlung/templates/fellchensammlung/instance-health-check.html index 584f2c3..5ef55e6 100644 --- a/src/fellchensammlung/templates/fellchensammlung/instance-health-check.html +++ b/src/fellchensammlung/templates/fellchensammlung/instance-health-check.html @@ -106,7 +106,15 @@ {% csrf_token %} + + +
+ {% csrf_token %} + +
diff --git a/src/fellchensammlung/views.py b/src/fellchensammlung/views.py index 3daf124..d2d4144 100644 --- a/src/fellchensammlung/views.py +++ b/src/fellchensammlung/views.py @@ -23,7 +23,8 @@ from .forms import AdoptionNoticeForm, AdoptionNoticeFormWithDateWidget, ImageFo from .models import Language, Announcement from .tools.geo import GeoAPI from .tools.metrics import gather_metrics_data -from .tools.admin import clean_locations, get_unchecked_adoption_notices, deactivate_unchecked_adoption_notices +from .tools.admin import clean_locations, get_unchecked_adoption_notices, deactivate_unchecked_adoption_notices, \ + deactivate_404_adoption_notices from .tasks import add_adoption_notice_location from rest_framework.authtoken.models import Token @@ -530,6 +531,8 @@ def instance_health_check(request): clean_locations(quiet=False) elif action == "deactivate_unchecked_adoption_notices": deactivate_unchecked_adoption_notices() + elif action == "deactivate_404": + deactivate_404_adoption_notices() number_of_adoption_notices = AdoptionNotice.objects.all().count() none_geocoded_adoption_notices = AdoptionNotice.objects.filter(location__isnull=True)