diff options
author | Alban Gruin | 2017-09-04 22:13:31 +0200 |
---|---|---|
committer | Alban Gruin | 2017-09-04 22:13:31 +0200 |
commit | ab9df7a174e2debbf9c644c8ec3e2127eeeaa3cf (patch) | |
tree | bf9510823644aa1c5dba0ab39277633c0f18ad49 /management/commands/timetables.py | |
parent | ce0ed9347adde9ca80c11efe79766c966d5749ba (diff) | |
parent | 4b3fc9e4c41e2247bf0fa0fe2629b2b57fc174b0 (diff) |
Merge branch 'stable/0.y.z' into prod/pa1ch/0.y.zv0.8.0-pa1chprod/pa1ch/0.8.z
Diffstat (limited to 'management/commands/timetables.py')
-rw-r--r-- | management/commands/timetables.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/management/commands/timetables.py b/management/commands/timetables.py index d39075d..d596233 100644 --- a/management/commands/timetables.py +++ b/management/commands/timetables.py @@ -64,6 +64,8 @@ class Command(BaseCommand): def handle(self, *args, **options): year = None + errcount = 0 + if options["week"] is None: _, week, day = timezone.now().isocalendar() if day >= 6: @@ -84,5 +86,9 @@ class Command(BaseCommand): process_timetable(timetable, year, weeks) except Exception as e: self.stderr.write(self.style.ERROR("Failed to process {0}: {1}".format(timetable, e))) + errcount += 1 - self.stdout.write(self.style.SUCCESS("Done.")) + if errcount == 0: + self.stdout.write(self.style.SUCCESS("Done.")) + else: + self.stdout.write(self.style.ERROR("Done with {0} errors.".format(errcount))) |