allura
リビジョン | a8a2afd33f8c70336c72e212f9abb8d7d916b4e9 (tree) |
---|---|
日時 | 2012-06-16 00:41:51 |
作者 | Tim Van Steenburgh <tvansteenburgh@gmai...> |
コミッター | Cory Johns |
[#4207] Also delete Forum and Ticket monitoring emails.
Signed-off-by: Tim Van Steenburgh <tvansteenburgh@gmail.com>
@@ -52,6 +52,12 @@ def scrub_project(p, options): | ||
52 | 52 | q['acl'] = {'$in': [ace]} |
53 | 53 | counter = 0 |
54 | 54 | if tool_name == 'tickets': |
55 | + if ac.options.get('TicketMonitoringEmail'): | |
56 | + log.info('%s options.TicketMonitoringEmail from the %s/%s ' | |
57 | + 'tool on project "%s"' % (preamble, tool_name, | |
58 | + mount_point, p.shortname)) | |
59 | + if not options.dry_run: | |
60 | + ac.options['TicketMonitoringEmail'] = None | |
55 | 61 | for tickets in utils.chunked_find(TM.Ticket, q): |
56 | 62 | for t in tickets: |
57 | 63 | counter += 1 |
@@ -96,10 +102,15 @@ def main(options): | ||
96 | 102 | (preamble, M.EmailAddress.query.find().count())) |
97 | 103 | log.info('%s email addresses from %s User documents' % |
98 | 104 | (preamble, M.User.query.find().count())) |
105 | + log.info('%s monitoring_email addresses from %s Forum documents' % | |
106 | + (preamble, DM.Forum.query.find({"monitoring_email": | |
107 | + {"$nin": [None, ""]}}).count())) | |
108 | + | |
99 | 109 | if not options.dry_run: |
100 | 110 | M.EmailAddress.query.remove() |
101 | 111 | M.User.query.update({}, {"$set": {"email_addresses": []}}, multi=True) |
102 | - | |
112 | + DM.Forum.query.update({"monitoring_email": {"$nin": [None, ""]}}, | |
113 | + {"$set": {"monitoring_email": None}}, multi=True) | |
103 | 114 | return 0 |
104 | 115 | |
105 | 116 |