def notify_mention(user, thing): try: inbox_rel = Inbox._add(user, thing, "mention") except CreationError: # this mention was already inserted, ignore it g.log.error("duplicate mention for (%s, %s)", user, thing) return with query_cache.CachedQueryMutator() as m: m.insert(queries.get_inbox_comment_mentions(user), [inbox_rel]) queries.set_unread(thing, user, unread=True, mutator=m)
def notify_mention(user, thing): inbox_rel = Inbox._add(user, thing, "mention") with query_cache.CachedQueryMutator() as m: m.insert(queries.get_inbox_comment_mentions(user), [inbox_rel]) queries.set_unread(thing, user, unread=True, mutator=m)