diff --git a/src/fellchensammlung/models.py b/src/fellchensammlung/models.py index 2fed585..40c5ec3 100644 --- a/src/fellchensammlung/models.py +++ b/src/fellchensammlung/models.py @@ -205,6 +205,9 @@ class RescueOrganization(models.Model): """ return self.instagram or self.facebook or self.website or self.phone_number or self.email or self.fediverse_profile + def set_exclusion_from_checks(self): + self.exclude_from_check = True + self.save() # Admins can perform all actions and have the highest trust associated with them diff --git a/src/fellchensammlung/templates/fellchensammlung/partials/partial-check-rescue-org.html b/src/fellchensammlung/templates/fellchensammlung/partials/partial-check-rescue-org.html index 4703d81..7f7eade 100644 --- a/src/fellchensammlung/templates/fellchensammlung/partials/partial-check-rescue-org.html +++ b/src/fellchensammlung/templates/fellchensammlung/partials/partial-check-rescue-org.html @@ -45,5 +45,16 @@ + \ No newline at end of file diff --git a/src/fellchensammlung/views.py b/src/fellchensammlung/views.py index eb9d573..24b114c 100644 --- a/src/fellchensammlung/views.py +++ b/src/fellchensammlung/views.py @@ -713,12 +713,14 @@ def rescue_organization_check(request, context=None): action = request.POST.get("action") if action == "checked": rescue_org.set_checked() + if action == "exclude": + rescue_org.set_exclusion_from_checks() if action == "set_species_url": species_url_form = SpeciesURLForm(request.POST) if species_url_form.is_valid(): species_url_instance = species_url_form.save(commit=False) - species_url_instance.rescues_organization_id = rescue_org.id + species_url_instance.rescue_organization_id = rescue_org.id species_url_instance.save() last_checked_rescue_orgs = RescueOrganization.objects.filter(exclude_from_check=False).order_by("last_checked")