=== modified file 'lib/lp/registry/model/person.py'
--- lib/lp/registry/model/person.py 2010-08-22 03:09:51 +0000
+++ lib/lp/registry/model/person.py 2010-08-22 04:16:05 +0000
@@ -2203,6 +2203,10 @@
# Get all of the teams this person participates in.
teams = list(self.teams_participated_in)
+ # For cases where self is a team, we don't need self as a team
+ # participated in.
+ teams = [team for team in teams if team != self]
+
# Get all of the memberships for any of the teams this person is
# a participant of. This must be ordered by date and id because
# because the graph of the results will create needs to contain
@@ -2210,9 +2214,16 @@
# IPerson.findPathToTeam.
store = Store.of(self) all_direct_memberships = store.find(TeamMembership,
- TeamMembership.personID.is_in(
- [team.id for team in teams] + [self.id])).order_by(
- Desc(TeamMembership.datejoined), Desc(TeamMembership.id))
+ And(
+ TeamMembership.personID.is_in(
+ [team.id for team in teams] + [self.id]),
+ TeamMembership.teamID != self.id,
+ TeamMembership.status.is_in([
+ TeamMembershipStatus.APPROVED,
+ TeamMembershipStatus.ADMIN,
+ ]))).order_by(
+ Desc(TeamMembership.datejoined),
+ Desc(TeamMembership.id))
# Cast the results to list now, because they will be iterated over
# several times. all_direct_memberships = list(all_direct_memberships)
=== modified file 'lib/lp/ registry/ model/person. py' registry/ model/person. py 2010-08-22 03:09:51 +0000 registry/ model/person. py 2010-08-22 04:16:05 +0000 teams_participa ted_in)
--- lib/lp/
+++ lib/lp/
@@ -2203,6 +2203,10 @@
# Get all of the teams this person participates in.
teams = list(self.
+ # For cases where self is a team, we don't need self as a team findPathToTeam.
all_direct_ memberships = store.find( TeamMembership, personID. is_in( )).order_ by( ship.datejoined ), Desc(TeamMember ship.id) ) personID. is_in( teamID != self.id, status. is_in([ tatus.APPROVED, tatus.ADMIN, ship.datejoined ), ship.id) )
all_direct_ memberships = list(all_ direct_ memberships)
+ # participated in.
+ teams = [team for team in teams if team != self]
+
# Get all of the memberships for any of the teams this person is
# a participant of. This must be ordered by date and id because
# because the graph of the results will create needs to contain
@@ -2210,9 +2214,16 @@
# IPerson.
store = Store.of(self)
- TeamMembership.
- [team.id for team in teams] + [self.id]
- Desc(TeamMember
+ And(
+ TeamMembership.
+ [team.id for team in teams] + [self.id]),
+ TeamMembership.
+ TeamMembership.
+ TeamMembershipS
+ TeamMembershipS
+ ]))).order_by(
+ Desc(TeamMember
+ Desc(TeamMember
# Cast the results to list now, because they will be iterated over
# several times.