Exemplo n.º 1
0
    def subscriber_data(self):
        """Return subscriber_ids in a form suitable for JavaScript use."""
        bug = IBug(self.context)
        data = self.direct_subscriber_data(bug)

        others = list(bug.getIndirectSubscribers())
        # If we have made it to here then the logged in user can see the
        # bug, hence they can see any indirect subscribers.
        include_private = self.user is not None
        if include_private:
            precache_permission_for_objects(
                self.request, 'launchpad.LimitedView', others)
        for person in others:
            if person == self.user:
                # Skip the current user viewing the page,
                continue
            if not include_private and person.private:
                # Do not include private teams if there's no logged in user.
                continue
            subscriber = {
                'name': person.name,
                'display_name': person.displayname,
                'web_link': canonical_url(person, rootsite='mainsite'),
                'self_link': absoluteURL(person, self.api_request),
                'is_team': person.is_team,
                'can_edit': False,
                }
            record = {
                'subscriber': subscriber,
                'subscription_level': 'Maybe',
                }
            data.append(record)
        return data
Exemplo n.º 2
0
 def render(self):
     for bugtask in IBug(self.context).bugtasks:
         if (IDistributionSourcePackage.providedBy(bugtask.target) and
             (not self.widgets['sourcepackagename'].hasInput())):
             self.widgets['sourcepackagename'].setRenderedValue(
                 bugtask.sourcepackagename)
             break
     return super(DistroBugTaskCreationStep, self).render()
Exemplo n.º 3
0
 def activity(self):
     activity = IBug(self.context).activity
     list(getUtility(IPersonSet).getPrecachedPersonsFromIDs(
         [a.personID for a in activity], need_validity=True))
     return activity
Exemplo n.º 4
0
 def page_description(self):
     return IBug(self.context).description
Exemplo n.º 5
0
 def subscription_info(self):
     return IBug(self.context).getSubscriptionInfo()