person.inTeam(other_person) hits the db (when both not teams)

Bug #591544 reported by Tim Penhey
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Low
Unassigned

Bug Description

Here is a snippet of my large debugging output. Here I know that user and self.obj.person are both individuals, so there should be no team participation check.

  File "/home/tim/src/launchpad/branch-index-slowness/lib/lp/code/security.py", line 28, in checkAuthenticated
    return (user.inTeam(self.obj.person) or
  File "/home/tim/src/launchpad/branch-index-slowness/lib/lp/registry/model/person.py", line 1126, in inTeam
    tp = TeamParticipation.selectOneBy(team=team, person=self)

<snippity>

SELECT TeamParticipation.id, TeamParticipation.person, TeamParticipation.team FROM TeamParticipation WHERE TeamParticipation.person = %s AND TeamParticipation.team = %s

We could special case this to avoid db queries.

Related branches

Revision history for this message
Curtis Hovey (sinzui) wrote :

I recall inTeam() also special cases the owner. We should make this method sensible.

Changed in launchpad-registry:
status: New → Triaged
importance: Undecided → Low
tags: added: tech-debt
Changed in launchpad-registry:
milestone: none → series-future
Curtis Hovey (sinzui)
Changed in launchpad-registry:
milestone: series-future → 10.10
assignee: nobody → Curtis Hovey (sinzui)
status: Triaged → In Progress
Curtis Hovey (sinzui)
Changed in launchpad-registry:
status: In Progress → Fix Committed
Revision history for this message
Launchpad QA Bot (lpqabot) wrote : Bug fixed by a commit
Ursula Junque (ursinha)
tags: added: qa-needstesting
Curtis Hovey (sinzui)
tags: added: qa-ok
removed: qa-needstesting
Revision history for this message
Launchpad QA Bot (lpqabot) wrote :
tags: added: qa-needstesting
removed: qa-ok
Curtis Hovey (sinzui)
tags: added: qa-ok
removed: qa-needstesting
Changed in launchpad-registry:
status: Fix Committed → Fix Released
Curtis Hovey (sinzui)
Changed in launchpad:
assignee: Curtis Hovey (sinzui) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.