def new_post_created(sender, **kwargs):
    post = kwargs['instance']
    if kwargs.get('raw'):
        # Don't run during loaddata
        return
    if not kwargs['created']:
        return  # We don't need to notify a topic poster of an edit.
    fire("concept_changes.new_post_created", obj=post, **kwargs)
Esempio n. 2
0
def new_post_created(sender, **kwargs):
    post = kwargs['instance']
    if kwargs.get('raw'):
        # Don't run during loaddata
        return
    if not kwargs['created']:
        return  # We don't need to notify a topic poster of an edit.
    fire("concept_changes.new_post_created", obj=post, **kwargs)
def new_comment_created(sender, **kwargs):
    comment = kwargs['instance']
    post = comment.post
    if kwargs.get('raw'):
        # Don't run during loaddata
        return
    if not kwargs['created']:
        return  # We don't need to notify a topic poster of an edit.
    if comment.author == post.author:
        return  # We don't need to tell someone they replied to themselves
    fire("concept_changes.new_comment_created", obj=comment)
Esempio n. 4
0
def new_comment_created(sender, **kwargs):
    comment = kwargs['instance']
    post = comment.post
    if kwargs.get('raw'):
        # Don't run during loaddata
        return
    if not kwargs['created']:
        return  # We don't need to notify a topic poster of an edit.
    if comment.author == post.author:
        return  # We don't need to tell someone they replied to themselves
    fire("concept_changes.new_comment_created", obj=comment)
def concept_saved(sender, instance, **kwargs):
    if not issubclass(sender, _concept):
        return
    if not instance.non_cached_fields_changed:
        # If the only thing that has changed is a cached public/locked status
        # then don't notify.
        return
    if kwargs.get('raw'):
        # Don't run during loaddata
        return
    kwargs['changed_fields'] = instance.changed_fields
    fire("concept_changes.concept_saved", obj=instance, **kwargs)
Esempio n. 6
0
def concept_saved(sender, instance, **kwargs):
    if not issubclass(sender, _concept):
        return
    if not instance.non_cached_fields_changed:
        # If the only thing that has changed is a cached public/locked status
        # then don't notify.
        return
    if kwargs.get('raw'):
        # Don't run during loaddata
        return
    kwargs['changed_fields'] = instance.changed_fields
    fire("concept_changes.concept_saved", obj=instance, **kwargs)
def review_request_changed(sender, instance, *args, **kwargs):
    if kwargs.get('created'):
        fire("action_signals.review_request_created", obj=instance, **kwargs)
    else:
        fire("action_signals.review_request_updated", obj=instance, **kwargs)
def states_changed(sender, instance, *args, **kwargs):
    fire("concept_changes.status_changed", obj=instance, **kwargs)
def states_changed(sender, instance, *args, **kwargs):
    item = instance.concept
    kwargs['status_id'] = instance.pk
    fire("concept_changes.status_changed", obj=item, **kwargs)
Esempio n. 10
0
def states_changed(sender, instance, *args, **kwargs):
    item = instance.concept
    kwargs['status_id'] = instance.pk
    fire("concept_changes.status_changed", obj=item, **kwargs)