Exemplo n.º 1
0
def createResponseNotif(sourceObj, recipientProfile, content, options):
    if isinstance(sourceObj, Shed):
        newNotification = Notification(sourceShed=sourceObj,
                                       options=options,
                                       content=content,
                                       recipient=recipientProfile,
                                       notificationType="request")
    elif isinstance(sourceObj, Tool):
        newNotification = Notification(sourceTool=sourceObj,
                                       options=options,
                                       content=content,
                                       recipient=recipientProfile,
                                       notificationType="request")
    elif isinstance(sourceObj, Profile):
        newNotification = Notification(sourceProfile=sourceObj,
                                       options=options,
                                       content=content,
                                       recipient=recipientProfile,
                                       notificationType="request")
    elif isinstance(sourceObj, Action):
        newNotification = Notification(sourceAction=sourceObj,
                                       options=options,
                                       content=content,
                                       recipient=recipientProfile,
                                       notificationType="request")

    newNotification.save()
    sendMail(recipientProfile, "You have a new notification!", content)
    #actionManager.processActions()
    return newNotification
Exemplo n.º 2
0
def createInfoNotif(sourceObj, recipientProfile, content):
    if isinstance(sourceObj, Shed):
        newNotification = Notification(sourceShed=sourceObj,
                                       content=content,
                                       recipient=recipientProfile,
                                       notificationType="info")
    elif isinstance(sourceObj, Tool):
        newNotification = Notification(sourceTool=sourceObj,
                                       content=content,
                                       recipient=recipientProfile,
                                       notificationType="info")
    elif isinstance(sourceObj, Profile):
        newNotification = Notification(sourceProfile=sourceObj,
                                       content=content,
                                       recipient=recipientProfile,
                                       notificationType="info")
    elif isinstance(sourceObj, Action):
        newNotification = Notification(sourceAction=sourceObj,
                                       content=content,
                                       recipient=recipientProfile,
                                       notificationType="info")

    newNotification.save()

    #send confirmation email
    sendMail(recipientProfile, "You have a new notification!", content)
    #actionManager.processActions()
    return newNotification
def createResponseNotif(sourceObj,recipientProfile,content,options):
    if isinstance(sourceObj, Shed):
        newNotification = Notification(sourceShed = sourceObj, options=options, content = content, recipient = recipientProfile, notificationType = "request")
    elif isinstance(sourceObj, Tool):
        newNotification = Notification(sourceTool = sourceObj, options=options, content = content, recipient = recipientProfile, notificationType = "request")
    elif isinstance(sourceObj, Profile):
       newNotification = Notification(sourceProfile = sourceObj, options=options, content = content, recipient = recipientProfile, notificationType = "request")
    elif isinstance(sourceObj, Action):
        newNotification = Notification(sourceAction = sourceObj, options=options, content = content, recipient = recipientProfile, notificationType = "request")

    newNotification.save()
    sendMail(recipientProfile, "You have a new notification!", content)
    #actionManager.processActions()
    return newNotification
def createInfoNotif(sourceObj,recipientProfile,content):
    if isinstance(sourceObj, Shed):
        newNotification = Notification(sourceShed = sourceObj, content = content, recipient = recipientProfile, notificationType = "info")
    elif isinstance(sourceObj, Tool):
        newNotification = Notification(sourceTool = sourceObj, content = content, recipient = recipientProfile, notificationType = "info")
    elif isinstance(sourceObj, Profile):
       newNotification = Notification(sourceProfile = sourceObj, content = content, recipient = recipientProfile, notificationType = "info")
    elif isinstance(sourceObj, Action):
        newNotification = Notification(sourceAction = sourceObj, content = content, recipient = recipientProfile, notificationType = "info")

    newNotification.save()

    #send confirmation email
    sendMail(recipientProfile, "You have a new notification!", content)
    #actionManager.processActions()
    return newNotification