Пример #1
0
 def get_responsible_widget_value(self, template):
     org_unit_id, responsible = self.replace_interactive_actors(template)
     actor_lookup = ActorLookup(responsible)
     if actor_lookup.is_inbox() or actor_lookup.is_team():
         return (u'{}'.format(actor_lookup.identifier), )
     else:
         return (u'{}:{}'.format(org_unit_id, actor_lookup.identifier), )
Пример #2
0
 def get_responsible_widget_value(self, template):
     org_unit_id, responsible = self.replace_interactive_actors(template)
     actor_lookup = ActorLookup(responsible)
     if actor_lookup.is_inbox() or actor_lookup.is_team():
         return (u'{}'.format(actor_lookup.identifier), )
     else:
         return (u'{}:{}'.format(org_unit_id, actor_lookup.identifier), )
Пример #3
0
    def get_user_ids(self):
        """Returns a list of userids which represents the given watcher:

        Means for a single user, a list with the user_id and for a inbox watcher,
        a list of the userids of all inbox_group users.
        """
        actor_lookup = ActorLookup(self.actorid)
        if actor_lookup.is_inbox() or actor_lookup.is_team():
            return [user.userid for user in
                    Actor.lookup(self.actorid).representatives()]

        return [self.actorid]
Пример #4
0
    def get_user_ids(self):
        """Returns a list of userids which represents the given watcher:

        Means for a single user, a list with the user_id and for a inbox watcher,
        a list of the userids of all inbox_group users.
        """
        actor_lookup = ActorLookup(self.actorid)
        if actor_lookup.is_inbox() or actor_lookup.is_team():
            return [
                user.userid
                for user in Actor.lookup(self.actorid).representatives()
            ]

        return [self.actorid]
Пример #5
0
    def get_user_ids(self):
        """Returns a list of userids which represents the given watcher:

        Means for a single user, a list with the user_id and for a inbox
        watcher, a list of the userids of all inbox_group users who have
        notify_inbox_actions set to True.
        """
        actor_lookup = ActorLookup(self.actorid)
        if actor_lookup.is_inbox() or actor_lookup.is_team():
            return [
                user.userid
                for user in Actor.lookup(self.actorid).representatives()
                if UserSettings.get_setting_for_user(user.userid,
                                                     'notify_inbox_actions')
            ]

        return [self.actorid]