diff --git a/notifications/handlers.py b/notifications/handlers.py index bdffeb33..9d11ad69 100644 --- a/notifications/handlers.py +++ b/notifications/handlers.py @@ -2,6 +2,8 @@ import logging from django.contrib.auth.models import User from .models import Notification +logger = logging.getLogger(__name__) + class NotificationHandler(logging.Handler): def emit(self, record): for user in User.objects.all(): @@ -10,5 +12,8 @@ class NotificationHandler(logging.Handler): notif.user = user notif.title = "%s [%s:%s]" % (record.levelname, record.funcName, record.lineno) notif.level = str([item[0] for item in Notification.LEVEL_CHOICES if item[1] == record.levelname][0]) - notif.message = record.getMessage() + message = record.getMessage() + message = message + "\n\n" + message = message + record.exc_text + notif.message = message notif.save() diff --git a/stock/templates/registered/notification_view.html b/stock/templates/registered/notification_view.html index 88bfb713..3c27e54b 100644 --- a/stock/templates/registered/notification_view.html +++ b/stock/templates/registered/notification_view.html @@ -13,7 +13,7 @@
{{ notif.message }}