Esempio n. 1
0
def push(obj, notif_type, send_on=None, repeating=False):
    return Notification(
        object=obj,
        notification_type=notif_type,
        send_on=send_on or datetime.date.today(),
        repeating=repeating,
    )
def add_notif(obj, notif_type, send_on=None):
    if not send_on:
        send_on = date.today()
    notif = Notification(
        object_id=obj.id,
        object_type=obj.type,
        notification_type=notif_type,
        send_on=send_on,
    )
    db.session.add(notif)