> It would be better to write this as
>
> + user.id == self.bug.ownerID):
>
> Using the ID column avoids doing a dereference-and-load which you
> don't want here. We've had timeouts fixed by little tweaks like this.
For bug owner it's okay, because I think it will only ever be an
individual. However, for assignee it can be a team, and comparing ID
won't work. Something like the following might be an okay compromise
for now:
user.id == self.bug.assigneeID or
user.inTeam(self.bug.assignee)
inTeam() could be changed to accept an ID and encapsulate this (and
perhaps also short-circuit to a query - instead of dereference first -
in the case of a team).
> It would be better to write this as and-load which you
>
> + user.id == self.bug.ownerID):
>
> Using the ID column avoids doing a dereference-
> don't want here. We've had timeouts fixed by little tweaks like this.
For bug owner it's okay, because I think it will only ever be an
individual. However, for assignee it can be a team, and comparing ID
won't work. Something like the following might be an okay compromise
for now:
user.id == self.bug.assigneeID or inTeam( self.bug. assignee)
user.
inTeam() could be changed to accept an ID and encapsulate this (and
perhaps also short-circuit to a query - instead of dereference first -
in the case of a team).