Skip to content

Commit

Permalink
SIO-1254 Do not spam admins when evaluation of a deleted submission f…
Browse files Browse the repository at this point in the history
…ails

Change-Id: Ic0a8a29f6d78891ad3db2eb8c6ae563a7629a369
  • Loading branch information
OIOIOI authored and matrach committed Aug 22, 2013
1 parent 6f9df2e commit 40a688d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions oioioi/contests/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,14 @@ def mail_admins_on_error(env, exc_info, **kwargs):
* `env['submission_id']`
"""

# We don't want to spam admins when the evaluation of a deleted
# submission fails. See also SIO-1254.
try:
if 'submission_id' in env:
Submission.objects.get(id=env['submission_id'])
except Submission.DoesNotExist:
return env

try:
mail_admins("System Error evaluating submission #%s" %
env.get('submission_id', '???'),
Expand Down

0 comments on commit 40a688d

Please sign in to comment.