~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/registry/model/pillaraffiliation.py

  • Committer: Jelmer Vernooij
  • Date: 2011-08-22 21:04:00 UTC
  • mfrom: (13261.7.21 bzr-2.4b4)
  • mto: This revision was merged to the branch mainline in revision 13941.
  • Revision ID: jelmer@canonical.com-20110822210400-3hfq31q2wgrtauad
Merge bzr-2.4b4.

Show diffs side-by-side

added added

removed removed

Lines of Context:
139
139
 
140
140
class BranchPillarAffiliation(BugTaskPillarAffiliation):
141
141
    """An affiliation adapter for branches."""
 
142
 
142
143
    def getPillar(self):
143
144
        return self.context.product or self.context.distribution
144
145
 
 
146
    def getBranch(self):
 
147
        return self.context
 
148
 
 
149
    def _getAffiliationDetails(self, person, pillar):
 
150
        super_instance = super(BranchPillarAffiliation, self)
 
151
        result = super_instance._getAffiliationDetails(person, pillar)
 
152
        if self.getBranch().isPersonTrustedReviewer(person):
 
153
            result.append((pillar.displayname, 'trusted reviewer'))
 
154
        return result
 
155
 
 
156
 
 
157
class CodeReviewVotePillarAffiliation(BranchPillarAffiliation):
 
158
    """An affiliation adapter for CodeReviewVotes."""
 
159
 
 
160
    def getPillar(self):
 
161
        """Return the target branch'pillar."""
 
162
        branch = self.getBranch()
 
163
        return branch.product or branch.distribution
 
164
 
 
165
    def getBranch(self):
 
166
        return self.context.branch_merge_proposal.target_branch
 
167
 
145
168
 
146
169
class DistroSeriesPillarAffiliation(PillarAffiliation):
147
170
    """An affiliation adapter for distroseries."""