14 lines
484 B
Python
14 lines
484 B
Python
# retoor <retoor@molodetz.nl>
|
|||
|
|
from molodetz.database import insert_notification
|
||
|
|
from molodetz.services.queue import background
|
||
|
|
from molodetz.utils.audit import record_system
|
||
|
|
|
||
|
|
|
||
|
|
def _persist(user_uid, kind, message, url):
|
||
|
|
insert_notification(user_uid, kind, message, url)
|
||
|
|
record_system("notification.create", payload={"kind": kind, "user_uid": user_uid})
|
||
|
|
|
||
|
|
|
||
|
|
def create_notification(user_uid, kind, message, url="/"):
|
||
|
|
background.submit(_persist, user_uid, kind, message, url)
|