diff --git a/notifications/__init__.py b/notifications/__init__.py index e69de29b..d12a961d 100644 --- a/notifications/__init__.py +++ b/notifications/__init__.py @@ -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