diff --git a/app/bird/templates/bird/bird_inactive.html b/app/bird/templates/bird/bird_inactive.html index 593eb39..a313b40 100644 --- a/app/bird/templates/bird/bird_inactive.html +++ b/app/bird/templates/bird/bird_inactive.html @@ -64,7 +64,7 @@ {{ bird.bird_identifier }} {{ bird.bird }} - {{ bird.date_found }} + {{ bird.date_found }} {{ bird.rescuer|default_if_none:"" }} diff --git a/app/bird/views.py b/app/bird/views.py index b0fbaac..b1f3c2a 100644 --- a/app/bird/views.py +++ b/app/bird/views.py @@ -50,9 +50,11 @@ def bird_help_single(request, id): @login_required(login_url="account_login") def bird_all(request): - birds = FallenBird.objects.filter(Q(status="1") | Q(status="2")).annotate( - total_costs=Sum("costs__costs") - ).order_by("date_found") + birds = ( + FallenBird.objects.filter(Q(status="1") | Q(status="2")) + .annotate(total_costs=Sum("costs__costs")) + .order_by("date_found") + ) rescuer_modal = Rescuer.objects.all() context = {"birds": birds, "rescuer_modal": rescuer_modal} # Post came from the modal form. @@ -68,9 +70,11 @@ def bird_all(request): @login_required(login_url="account_login") def bird_inactive(request): - birds = FallenBird.objects.filter( - ~Q(status="1") & ~Q(status="2")).annotate( - total_costs=Sum("costs__costs")) + birds = ( + FallenBird.objects.filter(~Q(status="1") & ~Q(status="2")) + .annotate(total_costs=Sum("costs__costs")) + .order_by("date_found") + ) context = {"birds": birds} return render(request, "bird/bird_inactive.html", context) @@ -83,10 +87,7 @@ def bird_recover_all(request): @login_required(login_url="account_login") def bird_single(request, id): bird = FallenBird.objects.get(id=id) - form = BirdEditForm( - request.POST or None, - request.FILES or None, - instance=bird) + form = BirdEditForm(request.POST or None, request.FILES or None, instance=bird) if request.method == "POST": if form.is_valid(): fs = form.save(commit=False) diff --git a/app/costs/templates/costs/costs_all.html b/app/costs/templates/costs/costs_all.html index ba4130c..34c0ada 100644 --- a/app/costs/templates/costs/costs_all.html +++ b/app/costs/templates/costs/costs_all.html @@ -18,7 +18,7 @@ -