Esempio n. 1
0
def note_delete_receiver(sender, **kwargs):
    if not 'instance' in kwargs:
        return
    note = kwargs['instance']

    # Update course and school counts of how
    # many notes they have
    update_note_counts(kwargs['instance'])

    # Remove document from search index
    try:
        index = SearchIndex()
        index.remove_note(note)
    except Exception:
        logger.error("Error with IndexDen:\n" + traceback.format_exc())

    if note.user:
        GenericKarmaEvent.create_event(note.user, note.name, GenericKarmaEvent.NOTE_DELETED)
Esempio n. 2
0
def note_delete_receiver(sender, **kwargs):
    if not 'instance' in kwargs:
        return
    note = kwargs['instance']

    # Update course and school counts of how
    # many notes they have
    update_note_counts(kwargs['instance'])

    # Remove document from search index
    try:
        index = SearchIndex()
        index.remove_note(note)
    except Exception:
        logger.error("Error with IndexDen:\n" + traceback.format_exc())

    if note.user:
        GenericKarmaEvent.create_event(note.user, note.name,
                                       GenericKarmaEvent.NOTE_DELETED)