fix: Allow to actually close AN
This commit is contained in:
@@ -11,12 +11,12 @@
|
||||
<div class="control">
|
||||
<div class="select">
|
||||
<select id="reason_for_closing" name="reason_for_closing">
|
||||
<option value="successful_with_notfellchen">{% translate 'Vermittelt mit Hilfe von Notfellchen' %}</option>
|
||||
<option value="successful_without_notfellchen">{% translate 'Vermittelt ohne Hilfe von Notfellchen' %}</option>
|
||||
<option value="closed_successful_with_notfellchen">{% translate 'Vermittelt mit Hilfe von Notfellchen' %}</option>
|
||||
<option value="closed_successful_without_notfellchen">{% translate 'Vermittelt ohne Hilfe von Notfellchen' %}</option>
|
||||
<option value="closed_for_other_adoption_notice">{% translate 'Vermittlung zugunsten einer anderen geschlossen' %}</option>
|
||||
<option value="not_open_for_adoption_anymore">{% translate 'Nicht mehr zu vermitteln (z.B. aufgrund von Krankheit)' %}</option>
|
||||
<option value="animal_died">{% translate 'Tod des Tiers' %}</option>
|
||||
<option value="other">{% translate 'Anderer Grund' %}</option>
|
||||
<option value="closed_not_open_for_adoption_anymore">{% translate 'Nicht mehr zu vermitteln (z.B. aufgrund von Krankheit)' %}</option>
|
||||
<option value="closed_animal_died">{% translate 'Tod des Tiers' %}</option>
|
||||
<option value="closed_other">{% translate 'Anderer Grund' %}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -929,7 +929,7 @@ def deactivate_an(request, adoption_notice_id):
|
||||
adoption_notice = get_object_or_404(AdoptionNotice, pk=adoption_notice_id)
|
||||
if request.method == "POST":
|
||||
reason_for_closing = request.POST.get("reason_for_closing")
|
||||
if reason_for_closing not in AdoptionNoticeStatusChoices.Closed.choices:
|
||||
if reason_for_closing not in AdoptionNoticeStatusChoices.Closed.values:
|
||||
return render(request, "fellchensammlung/errors/403.html", status=403)
|
||||
adoption_notice.adoption_notice_status = reason_for_closing
|
||||
adoption_notice.save()
|
||||
|
Reference in New Issue
Block a user