~deryck/+junk/lpjunk

« back to all changes in this revision

Viewing changes to notify_expiry.py

  • Committer: Deryck Hodge
  • Date: 2010-08-25 13:56:00 UTC
  • Revision ID: deryck@devurandom.org-20100825135600-zhbdywi9ba54c0me
A better way to ignore stuff owned by registry.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
from canonical.launchpad.interfaces.lpstorm import IMasterStore
26
26
from canonical.launchpad.interfaces.emailaddress import EmailAddressStatus
27
27
 
 
28
REGISTRY_ADMINS = 6213
 
29
 
28
30
MAIL_MSG = """
29
31
Hi,
30
32
 
95
97
            Product.enable_bug_expiration == True,
96
98
            Not(Product.bug_supervisor == None),
97
99
            Product.bug_supervisor == Person.id,
 
100
            Product.bug_supervisor != REGISTRY_ADMINS,
98
101
            EmailAddress.person == Person.id,
99
102
            EmailAddress.status == EmailAddressStatus.PREFERRED,
100
103
        ))
103
106
            Product.enable_bug_expiration == True,
104
107
            Product.bug_supervisor == None,
105
108
            Product._owner == Person.id,
 
109
            Product._owner != REGISTRY_ADMINS,
106
110
            EmailAddress.person == Person.id,
107
111
            EmailAddress.status == EmailAddressStatus.PREFERRED,
108
112
        ))
110
114
        projects = store.find(
111
115
            Product,
112
116
            Product.enable_bug_expiration == True,
 
117
            Product._owner != REGISTRY_ADMINS,
113
118
        )
114
119
 
115
120
        # Optionally, show a bit of info about this data.
126
131
 
127
132
        # Handle the emails.
128
133
        for project, person, email in contacts:
129
 
            # Skip anything "~registry" owns.
130
 
            if person.name == 'registry':
131
 
                continue
132
134
            msg = MAIL_MSG % {
133
135
                'project': project.name,
134
136
                'name': project.displayname}