From 372c29899f62f398a3cf620c5f8efd7d4b105a0e Mon Sep 17 00:00:00 2001 From: Daniel Brown Date: Sat, 3 Oct 2020 17:46:39 +0200 Subject: [PATCH] dont stop importing reports if exception occurs send mail instead --- src/players/management/commands/import_reports.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/players/management/commands/import_reports.py b/src/players/management/commands/import_reports.py index 92db116d..11673f94 100644 --- a/src/players/management/commands/import_reports.py +++ b/src/players/management/commands/import_reports.py @@ -100,7 +100,10 @@ def import_league(self, league): return for game in league.game_set.all(): - self.import_game(game) + try: + self.import_game(game) + except Exception: + logging.getLogger('mail').exception("Could not import Report") def import_game(self, game: Game): if self.options['games'] and game.number not in self.options['games']: