Fix null error when joining strings

This commit is contained in:
Adarnof 2016-02-21 01:09:32 -05:00
parent 26354751e8
commit c24c1f41ea

View File

@ -13,7 +13,8 @@ class NotificationHandler(logging.Handler):
notif.title = "%s [%s:%s]" % (record.levelname, record.funcName, record.lineno) 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.level = str([item[0] for item in Notification.LEVEL_CHOICES if item[1] == record.levelname][0])
message = record.getMessage() message = record.getMessage()
message = message + "\n\n" if record.exc_text:
message = message + record.exc_text message = message + "\n\n"
message = message + record.exc_text
notif.message = message notif.message = message
notif.save() notif.save()