~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/blueprints/model/specificationsubscription.py

[r=benji][bug=50875] Allow teams to be unsubscribed from blueprints
        and fix (modernise) form infrastructure.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
        storm_validator=validate_public_person, notNull=True)
34
34
    essential = BoolCol(notNull=True, default=False)
35
35
 
36
 
 
 
36
    def canBeUnsubscribedByUser(self, user):
 
37
        """See `ISpecificationSubscription`."""
 
38
        if user is None:
 
39
            return False
 
40
        if self.person.is_team:
 
41
            return user.inTeam(self.person)
 
42
        return user == self.person