Skip to content

Commit 6d85474

Browse files
committed
Minor reporting update
1 parent b2aa2e9 commit 6d85474

1 file changed

Lines changed: 19 additions & 3 deletions

File tree

app/grandchallenge/utilization/management/commands/link_challenge_utilization_to_invoice.py

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ def handle(self, *_, **__):
3131

3232
missing_invoice_challenges = []
3333
challenge_count = Challenge.objects.count()
34+
update_occured = False
3435

3536
for indx, challenge in enumerate(Challenge.objects.all()):
3637
prefix = f"[{challenge.short_name}]"
@@ -60,21 +61,36 @@ def handle(self, *_, **__):
6061
f"{prefix} {rows_updated} {model.__name__} updated."
6162
)
6263
)
64+
update_occured = True
65+
6366
self.stdout.write(
6467
self.style.SUCCESS(
6568
f"{prefix} Finished linking utilizations ({indx + 1}/{challenge_count})."
6669
)
6770
)
6871

69-
self.stdout.write(self.style.SUCCESS("Finished linking utilizations."))
72+
if update_occured:
73+
self.stdout.write(
74+
self.style.ERROR(
75+
"Overall: some utilizations were linked to invoices."
76+
)
77+
)
78+
else:
79+
self.stdout.write(
80+
self.style.SUCCESS(
81+
"Overall: no utilizations were linked to invoices."
82+
)
83+
)
7084

7185
if missing_invoice_challenges:
7286
self.stdout.write(
7387
self.style.ERROR(
74-
f"No invoice found for {len(missing_invoice_challenges)} challenges: {', '.join(missing_invoice_challenges)}."
88+
f"Overall: no invoice found for {len(missing_invoice_challenges)} challenges: {', '.join(missing_invoice_challenges)}."
7589
)
7690
)
7791
else:
7892
self.stdout.write(
79-
self.style.SUCCESS("All challenges had an invoice to link to.")
93+
self.style.SUCCESS(
94+
"Overall: all challenges had an invoice to link to."
95+
)
8096
)

0 commit comments

Comments
 (0)