1. Viorel Stirbu
  2. atex

Commits

Viorel Stirbu  committed e860a5e

send html email with APIError and request context

  • Participants
  • Parent commits bda803c
  • Branches master

Comments (0)

Files changed (2)

File atexpc/atex_web/views.py

View file
  • Ignore whitespace
         try:
             response = super(GenericView, self).get(request, *args, **kwargs)
         except APIError as e:
-            logger.error(e)
+            logger.error(e, extra={'request': self.request})
             # context = self.get_context_data(params=kwargs)
             context = {'error': e}
             response = self.render_to_response(context)

File atexpc/settings.py

View file
  • Ignore whitespace
         'mail_admins': {
             'level': 'ERROR',
             'filters': ['require_debug_false'],
-            'class': 'django.utils.log.AdminEmailHandler'
+            'class': 'django.utils.log.AdminEmailHandler',
+            'include_html': True
         }
     },
     'loggers': {