Ejemplo n.º 1
0
Archivo: legacy.py Proyecto: 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))
Ejemplo n.º 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))
Ejemplo n.º 3
0
Archivo: legacy.py Proyecto: 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))
Ejemplo n.º 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))
Ejemplo n.º 5
0
    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))
Ejemplo n.º 6
0
    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))