feat: allow to exclude from check
This commit is contained in:
@@ -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
|
||||
|
@@ -45,5 +45,16 @@
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<div class="card-footer-item is-paddingless">
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
<input type="hidden"
|
||||
name="rescue_organization_id"
|
||||
value="{{ rescue_org.pk }}">
|
||||
<input type="hidden" name="action" value="exclude">
|
||||
<button class="is-primary is-fullwidth" type="submit">{% translate "Von Check exkludieren" %}</button>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@@ -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")
|
||||
|
Reference in New Issue
Block a user