def add_concepts_to_glossary_index(sender, instance, created, **kwargs): if not issubclass(sender, MDR._concept): return fire("reindex_metadata_item_async", obj=instance, **kwargs, namespace="aristotle_glossary.async_signals")
def new_post_created(sender, instance, **kwargs): # Don't pass the instance to the JSONEncoder post = 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("notification_events.new_post_created", obj=post, **kwargs)
def new_comment_created(sender, instance, **kwargs): comment = 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("notification_events.new_comment_created", obj=comment, **kwargs)
def concept_saved(sender, **kwargs): revision = kwargs.pop('revision') versions = kwargs.pop('versions') version = versions[0] if not issubclass(version._model, _concept): return user_id = revision.user_id if user_id is not None: fire("notification_events.create_notifications_for_saved_concept", obj=version, user_id=user_id, **kwargs)
def new_issue_comment_created(sender, instance, *args, **kwargs): # issue_comment = kwargs['instance'] if kwargs.get('created'): fire("notification_events.issue_commented", 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 item_viewed(sender, *args, **kwargs): fire("signals.item_viewed_action", namespace="aristotle_mdr.contrib.view_history", obj=sender, **kwargs)
def review_request_created(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 new_issue_comment_created(sender, instance, *args, **kwargs): # issue_comment = kwargs['instance'] if kwargs.get('created'): fire("concept_changes.issue_commented", obj=instance, **kwargs)
def new_superseded_relation(sender, instance, *args, **kwargs): if kwargs.get('created'): fire("notification_events.item_superseded", obj=instance, **kwargs)
def states_changed(sender, instance, *args, **kwargs): fire("notification_events.status_changed", obj=instance, **kwargs)