diff --git a/app/costs/templates/costs/costs_all.html b/app/costs/templates/costs/costs_all.html index 610d937..abb67c1 100644 --- a/app/costs/templates/costs/costs_all.html +++ b/app/costs/templates/costs/costs_all.html @@ -60,7 +60,7 @@ {% for item in costs %} - {{item.id_bird}} + {{item.id_bird|default_if_none:"nicht mehr in WVH"}} {{item.costs}} {{item.created}} {{item.comment|default_if_none:""}} diff --git a/app/rescuer/views.py b/app/rescuer/views.py index 12dff1e..4d5ea36 100644 --- a/app/rescuer/views.py +++ b/app/rescuer/views.py @@ -1,5 +1,7 @@ from django.contrib.auth.decorators import login_required from django.shortcuts import render, redirect +from django.db.models import Q + from .forms import RescuerForm from .models import Rescuer @@ -16,7 +18,7 @@ def rescuer_all(request): @login_required(login_url="account_login") def rescuer_single(request, id): rescuer = Rescuer.objects.get(id=id) - birds = FallenBird.objects.filter(rescuer=id) + birds = FallenBird.objects.filter(rescuer=id).filter(Q(status="1") | Q(status="2")) context = {"rescuer": rescuer, "birds": birds} return render(request, "rescuer/rescuer_single.html", context)