~launchpad-pqm/launchpad/devel

« back to all changes in this revision

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

  • Committer: Launchpad Patch Queue Manager
  • Date: 2012-01-06 19:56:39 UTC
  • mfrom: (14642.2.5 403-private-team-in-page)
  • Revision ID: launchpad@pqm.canonical.com-20120106195639-ix60p6xlxfwwom9c
[r=aduering][bug=911794] Do not assume the team is public when
        listing teams.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3587
3587
 
3588
3588
    def latest_teams(self, limit=5):
3589
3589
        """See `IPersonSet`."""
3590
 
        return Person.select("Person.teamowner IS NOT NULL",
3591
 
            orderBy=['-datecreated'], limit=limit)
 
3590
        orderby = (Desc(Person.datecreated), Desc(Person.id))
 
3591
        result = IStore(Person).find(
 
3592
            Person,
 
3593
            And(
 
3594
                self._teamPrivacyQuery(),
 
3595
                TeamParticipation.team == Person.id,
 
3596
                Person.teamowner != None,
 
3597
                Person.merged == None))
 
3598
        return result.order_by(orderby).config(distinct=True)[:limit]
3592
3599
 
3593
3600
    def _merge_person_decoration(self, to_person, from_person, skip,
3594
3601
        decorator_table, person_pointer_column, additional_person_columns):