Code review comment for lp:~intellectronica/launchpad/oops-462742

Revision history for this message
Björn Tillenius (bjornt) wrote :

On Wed, Oct 28, 2009 at 06:05:27PM -0000, Tom Berger wrote:
> === modified file 'lib/canonical/launchpad/database/structuralsubscription.py'
> --- lib/canonical/launchpad/database/structuralsubscription.py 2009-10-23 13:51:40 +0000
> +++ lib/canonical/launchpad/database/structuralsubscription.py 2009-10-28 18:05:23 +0000
> @@ -331,9 +331,10 @@
> """See `IStructuralSubscriptionTarget`."""
> bug_subscriptions = self.getSubscriptions(
> min_bug_notification_level=BugNotificationLevel.METADATA)
> - for subscription in bug_subscriptions:
> - if (subscription.subscriber == user or
> - user.inTeam(subscription.subscriber)):
> - # The user has a bug subscription
> - return True
> + if IPerson.providedBy(user):

What different kinds of objects can 'user' be?

> + for subscription in bug_subscriptions:
> + if (subscription.subscriber == user or
> + user.inTeam(subscription.subscriber)):
> + # The user has a bug subscription
> + return True
> return False

--
Björn Tillenius | https://launchpad.net/~bjornt

« Back to merge proposal