コード例 #1
0
ファイル: legacy.py プロジェクト: fph/indico
 def linkTo(self, obj, role):
     if not self.user or self.user.is_deleted:
         return
     link = self.user.link_to(obj, role)
     if link and redis_write_client:
         event = avatar_links.event_from_obj(obj)
         if event:
             avatar_links.add_link(self.user, event, '{}_{}'.format(link.type, link.role))
コード例 #2
0
 def linkTo(self, obj, role):
     if not self.user or self.user.is_deleted:
         return
     link = self.user.link_to(obj, role)
     if link and redis_write_client:
         event = avatar_links.event_from_obj(obj)
         if event:
             avatar_links.add_link(self.user, event, '{}_{}'.format(link.type, link.role))
コード例 #3
0
ファイル: legacy.py プロジェクト: fph/indico
 def unlinkTo(self, obj, role):
     if not self.user or self.user.is_deleted:
         return
     links = self.user.unlink_to(obj, role)
     if redis_write_client:
         for link in links:
             event = avatar_links.event_from_obj(obj)
             if event:
                 avatar_links.del_link(self.user, event, '{}_{}'.format(link.type, link.role))
コード例 #4
0
 def unlinkTo(self, obj, role):
     if not self.user or self.user.is_deleted:
         return
     links = self.user.unlink_to(obj, role)
     if redis_write_client:
         for link in links:
             event = avatar_links.event_from_obj(obj)
             if event:
                 avatar_links.del_link(self.user, event, '{}_{}'.format(link.type, link.role))
コード例 #5
0
ファイル: legacy.py プロジェクト: marcosmolla/indico
    def linkTo(self, obj, role):
        # deleted users shouldn't be able to be linked
        # TODO: log deleted users?

        if not self.user.is_deleted:
            link = self.user.link_to(obj, role)
            if link and redis_write_client:
                event = avatar_links.event_from_obj(obj)
                if event:
                    avatar_links.add_link(self, event, '{}_{}'.format(link.type, link.role))
コード例 #6
0
ファイル: legacy.py プロジェクト: marcosmolla/indico
    def linkTo(self, obj, role):
        # deleted users shouldn't be able to be linked
        # TODO: log deleted users?

        if not self.user.is_deleted:
            link = self.user.link_to(obj, role)
            if link and redis_write_client:
                event = avatar_links.event_from_obj(obj)
                if event:
                    avatar_links.add_link(self, event,
                                          '{}_{}'.format(link.type, link.role))