handler.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:iguana 作者: iguana-project 项目源码 文件源码
def handle(self, sender, signal, **kwargs):
        # only add things to the activity stream if there's a user
        if kwargs.get("user", None) is None:
            return

        target = self.getTargetObj(**kwargs)

        # invalidate cache for target followers
        users = followers(target)
        for user in users:
            update_activity_stream_for_user.delay(user.username)
        update_activity_stream_for_user.delay(kwargs['user'].username, actor=True)
        if signal == signals.create:
            action.send(kwargs['user'], verb=self.createVerb, action_object=kwargs['instance'], target=target)
        if signal == signals.modify:
            action.send(kwargs['user'], verb=self.modifyVerb, action_object=kwargs['instance'], target=target)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号