Changeset 4098256
- Timestamp:
- Nov 12, 2011, 3:46:00 AM (14 years ago)
- Branches:
- master, space-access, stable, stage, test-hooks
- Children:
- ea217bd
- Parents:
- 73f0faf
- git-author:
- Alex Dehnert <adehnert@…> (11/12/11 02:57:03)
- git-committer:
- Alex Dehnert <adehnert@…> (11/12/11 03:46:00)
- Location:
- asadb
- Files:
-
- 2 added
- 1 edited
-
groups/diffs.py (modified) (3 diffs, 1 prop)
-
template/groups/diffs/asa-official-update.txt (added)
-
util/mailman.py (added)
Legend:
- Unmodified
- Added
- Removed
-
asadb/groups/diffs.py
- Property mode changed from 100644 to 100755
r73f0faf r4098256 22 22 import groups.models 23 23 import settings 24 import util.emails 25 import util.mailman 24 26 25 27 update_asa_exec = 'asa-exec@mit.edu' 26 28 update_funding_board = 'asa-db@mit.edu' 27 29 update_constitution_archive = 'asa-db@mit.edu' 30 31 asa_all_groups_list = util.mailman.MailmanList('asa-official') 32 asa_all_groups_list = util.mailman.MailmanList('asa-test-mailman') 28 33 29 34 class DiffCallback(object): … … 121 126 self.signatory_updates = [] 122 127 128 129 class UpdateOfficerListCallback(DiffCallback): 130 def start_run(self, since, now, ): 131 self.add = [] 132 self.delete = [] 133 134 def end_run(self, ): 135 if self.add or self.delete: 136 errors = asa_all_groups_list.change_members(self.add, self.delete) 137 subject = "asa-official updater" 138 if errors: 139 subject = "ERROR: " + subject 140 context = { 141 'add': self.add, 142 'delete': self.delete, 143 'errors': errors, 144 } 145 util.emails.email_from_template( 146 tmpl='groups/diffs/asa-official-update.txt', 147 context=context, subject=subject, 148 to=['testing@mit.edu'], 149 ).send() 150 151 def handle_group(self, before, after, before_fields, after_fields, ): 152 if before_fields['officer_email'] != after_fields['officer_email']: 153 self.add.append("%s <%s>" % (after_fields['name'], after_fields['officer_email'], )) 154 self.delete.append(before_fields['officer_email']) 155 156 def new_group(self, after, after_fields, ): 157 self.add.append(after_fields['officer_email']) 158 159 123 160 diff_fields = { 124 161 'name' : [ update_asa_exec, ], … … 144 181 sao_callback.care_about_groups = False 145 182 callbacks.append(sao_callback) 183 callbacks.append(UpdateOfficerListCallback()) 146 184 return callbacks 147 185
Note: See TracChangeset
for help on using the changeset viewer.