summaryrefslogtreecommitdiff
path: root/sstreasury/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'sstreasury/views.py')
-rw-r--r--sstreasury/views.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/sstreasury/views.py b/sstreasury/views.py
index 9b1da59..689a451 100644
--- a/sstreasury/views.py
+++ b/sstreasury/views.py
@@ -21,6 +21,7 @@ from django.core.validators import validate_email
from django.conf import settings
from django.db import transaction
+from django.db.models import Q
from django.http import HttpResponse
from django.shortcuts import render, redirect
from django.urls import reverse
@@ -251,10 +252,16 @@ def budget_view(request, budget, revision):
history = list(itertools.chain(budget.budgetrevision_set.all(), revision.budget.budgetcomment_set.all()))
history.sort(key=lambda x: x.time, reverse=True)
+ if revision.state == models.BudgetState.APPROVED.value and 'revision' not in request.GET:
+ claims = models.ReimbursementClaim.objects.filter(Q(budget_id=str(budget.id)) | Q(budget_id__endswith='-{}'.format(budget.id))).all()
+ else:
+ claims = None
+
return render(request, 'sstreasury/budget_view.html', {
'revision': revision,
'history': history,
- 'is_latest': 'revision' not in request.GET
+ 'is_latest': 'revision' not in request.GET,
+ 'claims': claims
})
@login_required
Contact (issues, pull requests, etc.) at git@yingtongli.me. Generated by cgit.