Exemplo n.º 1
0
def lectureModified(obj, event=None):
    portal_workflow = getToolByName(obj, "portal_workflow")
    logger.debug("lecture %s modified" % obj.id)

    status = portal_workflow.getStatusOf("simple_publication_workflow", obj)
    if status and status.get("review_state", None) == "published":
        dbLec = syncPloneLecture(obj)
        syncPloneQuestions(dbLec, obj)
    else:
        removePloneLecture(obj)
Exemplo n.º 2
0
def registryUpdated(obj, event=None):
    logger.debug("registry object updated")
    for l in _childrenOfType(getSite(), "tw_lecture"):
        # Make sure lectures inheriting settings are up-to-date
        syncPloneLecture(l)
Exemplo n.º 3
0
def questionRemoved(obj, event):
    logger.debug("question %s removed" % obj.id)

    # NB: Ideally we just sync the questions, but need the dbLec anyway
    if event.oldParent.portal_type == 'tw_lecture':
        syncPloneQuestions(syncPloneLecture(event.oldParent), event.oldParent)
Exemplo n.º 4
0
def questionModified(obj, event=None):
    logger.debug("question %s modified" % obj.id)

    # NB: Ideally we just sync the questions, but need the dbLec anyway
    syncPloneQuestions(syncPloneLecture(obj.aq_parent), obj.aq_parent)
Exemplo n.º 5
0
def tutorialModified(obj, event=None):
    logger.debug("tutorial %s modified" % obj.id)

    for l in _childrenOfType(obj, "tw_lecture"):
        # Make sure lectures inheriting settings are up-to-date
        syncPloneLecture(l)