Added a filter to stop reporting failed uploads to the admin email address -- these seem to occur regularly when a client looses (WiFi) connectivity, and this is not something we can do anything about.

- Legacy-Id: 8212
This commit is contained in:
Henrik Levkowetz 2014-07-26 11:31:16 +00:00
parent fd9ee73df3
commit a78cb8ce36

View file

@ -122,6 +122,22 @@ LOGGING['filters']['skip_suspicious_operations'] = {
'callback': skip_suspicious_operations,
}
LOGGING['handlers']['mail_admins']['filters'] += [ 'skip_suspicious_operations' ]
# Filter out UreadablePostError:
from django.http import UnreadablePostError
def skip_unreadable_post(record):
if record.exc_info:
exc_type, exc_value = record.exc_info[:2]
if isinstance(exc_value, UnreadablePostError):
return False
return True
LOGGING['filters']['skip_unreadable_posts'] = {
'()': 'django.utils.log.CallbackFilter',
'callback': skip_unreadable_post,
}
LOGGING['handlers']['mail_admins']['filters'] += [ 'skip_unreadable_posts' ]
# End logging
# ------------------------------------------------------------------------