Adarnof 0807bc98a3 Shorthand notify command
Notifications on API key update failures
Notifications on application status updates
Notifications on services disabled
2016-02-17 22:30:43 +00:00

13 lines
324 B
Python

from .models import Notification
def notify(user, title, message=None, level='info'):
notif = Notification()
notif.user = user
notif.title = title
if not message:
message = title
notif.message = message
notif.level = level
notif.save()
logger.info("Created notification %s" % notif)