Notify function

This commit is contained in:
Adarnof 2016-02-17 22:07:08 +00:00
parent 0622d2f146
commit 1d3d1b53a4

View File

@ -0,0 +1,12 @@
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