Skip to content

Commit 0dfff39

Browse files
btidorbtidor
btidor
authored andcommitted
More changes to the finaid scripts. No idea where they came from, they
just showed up here.
1 parent 4ea4f46 commit 0dfff39

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

Diff for: esp/useful_scripts/finaid_approve.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,20 @@
2020

2121

2222
# ITERATE & APPROVE REQUESTS
23-
reqs = FinancialAidRequest.objects.filter(done = False, program__name=PROGRAM).exclude(household_income = None, extra_explaination = None)
23+
reqs = FinancialAidRequest.objects.filter(program__name=PROGRAM)
2424

2525
print "New Approvals:"
2626
approved_any = False
2727

28+
def is_blank(x):
29+
return x is None or re.match(r'^(\s)*$', x)
30+
2831
for req in reqs:
29-
if (req.household_income is None or re.match(r'^(\s)*$', req.household_income)) and \
30-
(req.extra_explaination is None or re.match(r'(\s)*$', req.extra_explaination)):
32+
if is_blank(req.household_income) and is_blank(req.extra_explaination):
3133
continue
3234

33-
if req.financialaidgrant_set.all().count() != 0 : continue
35+
if req.approved:
36+
continue
3437

3538
print req.user.email
3639
try:

Diff for: esp/useful_scripts/finaid_autoapproved.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,13 @@
1818
PROGRAM = "Splash 2014"
1919

2020
# ITERATE & APPROVE REQUESTS
21-
reqs = FinancialAidRequest.objects.filter(program__name=PROGRAM).exclude(done=False)
21+
reqs = FinancialAidRequest.objects.filter(program__name=PROGRAM)
2222
tagged_reqs = {}
2323

2424
print "Auto-Approved Requests"
2525

2626
for req in reqs:
27-
if not req.financialaidgrant_set.count():
28-
print " Skipping %s, request never approved" % req.user.username
27+
if not req.approved:
2928
continue
3029
date = min(x['timestamp'].date() for x in req.financialaidgrant_set.values())
3130
lst = tagged_reqs.get(date, [])

0 commit comments

Comments
 (0)