Commits

Viorel Stirbu committed e860a5e

send html email with APIError and request context

Comments (0)

Files changed (2)

atexpc/atex_web/views.py

         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)

atexpc/settings.py

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