~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/blueprints/interfaces/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:
11
11
    'ISpecificationSubscription',
12
12
    ]
13
13
 
 
14
from lazr.restful.declarations import (
 
15
    call_with,
 
16
    export_as_webservice_entry,
 
17
    export_read_operation,
 
18
    operation_for_version,
 
19
    REQUEST_USER,
 
20
    )
14
21
from zope.interface import (
15
22
    Attribute,
16
23
    Interface,
27
34
class ISpecificationSubscription(Interface):
28
35
    """A subscription for a person to a specification."""
29
36
 
 
37
    export_as_webservice_entry(publish_web_link=False, as_of='devel')
 
38
 
30
39
    id = Int(
31
40
        title=_('ID'), required=True, readonly=True)
32
41
    person = PublicPersonChoice(
47
56
        'attends meetings about this feature.'),
48
57
        default=False)
49
58
 
 
59
    @call_with(user=REQUEST_USER)
 
60
    @export_read_operation()
 
61
    @operation_for_version("devel")
 
62
    def canBeUnsubscribedByUser(user):
 
63
        """Can the user unsubscribe the subscriber from the specification?"""