Changes in / [a53f8ee:05f5712]
- Files:
-
- 1 added
- 1 deleted
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
asadb/groups/diffs.py
r80a8145 rb2cee30 59 59 self.signatory_updates = [] 60 60 self.signatory_type_counts = { 61 'Added': {},62 'Expired': {},61 'Added': collections.defaultdict(lambda: 0), 62 'Expired': collections.defaultdict(lambda: 0), 63 63 } 64 self.signatory_types_seen = set() 64 65 self.since = since 65 66 self.now = now 66 self.stats = collections.defaultdict(lambda: 0)67 67 68 68 def handle_group(self, before, after, before_fields, after_fields, ): … … 85 85 change_type = "Expired" 86 86 counter = self.signatory_type_counts[change_type] 87 if signatory.role.slug in counter: 88 counter[signatory.role.slug] += 1 89 else: 90 counter[signatory.role.slug] = 0 87 counter[signatory.role.slug] += 1 88 self.signatory_types_seen.add(signatory.role.slug) 91 89 if signatory.role.slug in self.interesting_signatories: 92 90 if signatory.group != prev_group: … … 103 101 prev_group = signatory.group 104 102 else: 105 self.stats["role." + signatory.role.slug] += 1103 pass 106 104 #print "Ignoring role %s (signatory %s)" % (signatory.role.slug, signatory, ) 107 105 106 def build_change_stats(self, ): 107 lines = [] 108 care_about = 0 109 110 line = "%20s" % ("", ) 111 change_types = self.signatory_type_counts.keys() 112 for change_type in change_types: 113 line += "\t%s" % (change_type, ) 114 lines.append(line); line = "" 115 116 for sig_type in self.signatory_types_seen: 117 anno_sig = sig_type 118 if sig_type in self.interesting_signatories: 119 anno_sig += " " 120 else: 121 anno_sig += "*" 122 line += "%20s" % (anno_sig, ) 123 for change_type in change_types: 124 if sig_type in self.signatory_type_counts[change_type]: 125 count = self.signatory_type_counts[change_type][sig_type] 126 else: 127 count = 0 128 if sig_type in self.interesting_signatories: 129 care_about += count 130 out = "\t%4d" % (count, ) 131 line += out 132 lines.append(line); line = "" 133 134 line = "* Details for this signatory type not included in email." 135 lines.append(line) 136 137 return "\n".join(lines), care_about 138 108 139 def end_run(self, ): 140 change_stats, care_about = self.build_change_stats() 109 141 print "\nChange stats for email to %s:" % (self.address, ) 110 for stat_key, stat_val in self.stats.items(): 111 print "%20s:\t%6d" % (stat_key, stat_val, ) 112 print "" 142 print change_stats 113 143 114 144 message = "\n\n".join(self.updates) … … 122 152 'num_groups': len(self.updates), 123 153 'groups_message': message, 124 'num_signatory_records': len(self.signatory_updates), 154 'care_about': care_about, 155 'change_stats': change_stats, 125 156 'signatory_types': self.interesting_signatories, 126 'signatory_type_counts': self.signatory_type_counts,127 157 'signatories_message': signatories_message, 128 158 }) … … 144 174 self.add = [] 145 175 self.delete = [] 176 self.notes = [] 146 177 147 178 def end_run(self, ): … … 156 187 'delete': self.delete, 157 188 'errors': errors, 189 'notes': self.notes, 158 190 } 159 191 util.emails.email_from_template( … … 164 196 165 197 def handle_group(self, before, after, before_fields, after_fields, ): 166 if before_fields['officer_email'] != after_fields['officer_email']: 198 before_addr = before_fields['officer_email'] 199 after_addr = after_fields['officer_email'] 200 if before_addr != after_addr: 167 201 name = after_fields['name'] 168 self.add.append((after_fields['name'], after_fields['officer_email'], )) 169 self.delete.append(before_fields['officer_email']) 202 if after_addr: 203 self.add.append((name, after_addr, )) 204 else: 205 self.notes.append("%s: Not adding because address is blank." % (name, )) 206 if before_addr and after_addr: 207 # Don't remove an address unless there's a replacement 208 self.delete.append(before_fields['officer_email']) 209 else: 210 self.notes.append("%s: Not removing '%s' (to add '%s') because at least one is blank." % (name, before_addr, after_addr, )) 170 211 171 212 def new_group(self, after, after_fields, ): … … 250 291 qobj_expired = Q(end_time__lte=now, start_time__lte=since, end_time__gte=since) 251 292 changed_signatories = groups.models.OfficeHolder.objects.filter(qobj_added|qobj_expired) 252 changed_signatories .order_by('group__name', 'role__display_name', 'person', )293 changed_signatories = changed_signatories.order_by('group__name', 'role__display_name', 'person', ) 253 294 changed_signatories = changed_signatories.select_related('role', 'group') 254 295 for callback in callbacks: callback.handle_signatories(changed_signatories) -
asadb/groups/find_missing_transition.py
r2a587e4 r0dc771d 18 18 def get_roles(): 19 19 roles = [ 20 ['president', True, 'No president listed', ], 20 21 ['treasurer', True, 'No treasurer listed', ], 21 22 ['financial', False, 'No financial signatories listed. At minimum, this should generally be your president and treasurer.', ], … … 62 63 fail, problems = check_group(group, roles, ) 63 64 if fail: 64 to = [officers[group.pk]] 65 try: 66 to = [officers[group.pk]] 67 except KeyError: 68 print "Group %s not found in CSV" % (group, ) 65 69 if group.officer_email: 66 70 to.append(group.officer_email) … … 81 85 connection = mail.get_connection() 82 86 #connection.send_messages(emails) 83 for email in emails: print email.subject 87 for email in emails: 88 print email.subject 89 print email.body 84 90 print len(emails) 85 91 -
asadb/groups/load_people.py
rdc81a9e r2538f75 137 137 Initial in Django: %(django_people)6d 138 138 People in DCM: %(dcm_people)6d 139 Already Deleted: %(pre_del)6d 140 Unchanged: %(unchanged)6d 139 141 Changed: %(changed)6d 140 142 Change ignored: %(mut_ign)6d 141 Unchanged: %(unchanged)6d142 143 Deleted: %(del)6d 143 Already Deleted: %(pre_del)6d144 144 Undeleted: %(undel)6d 145 Added: %(add)6d""" % stats 145 Added: %(add)6d 146 """ % stats 146 147 147 148 for change_type, people in stat_people.items(): -
asadb/groups/models.py
rf8bd496 rfd5cc07 42 42 main_account_id = models.IntegerField(null=True, blank=True, ) 43 43 funding_account_id = models.IntegerField(null=True, blank=True, ) 44 athena_locker = models.CharField(max_length=20, blank=True )44 athena_locker = models.CharField(max_length=20, blank=True, help_text="Often, this will appear in your group's URL --- http://web.mit.edu/SOME_VARIANT_OF_GROUP_NAME/, http://www.mit.edu/~SOME_VARIANT_OF_GROUP_NAME/ and http://SOME_VARIANT_OF_GROUP_NAME.scripts.mit.edu/ all correspond to a locker name of SOME_VARIANT_OF_GROUP_NAME. Also, you can probably find this in your entry in the old database.") 45 45 recognition_date = models.DateTimeField() 46 46 update_date = models.DateTimeField(editable=False, ) … … 112 112 reversion.register(Group) 113 113 114 115 GROUP_STARTUP_STAGE_SUBMITTED = 10116 GROUP_STARTUP_STAGE_APPROVED = 20117 GROUP_STARTUP_STAGE_REJECTED = -10118 GROUP_STARTUP_STAGE = (119 (GROUP_STARTUP_STAGE_SUBMITTED, 'submitted'),120 (GROUP_STARTUP_STAGE_APPROVED, 'approved'),121 (GROUP_STARTUP_STAGE_REJECTED, 'rejected'),122 )123 114 124 115 constitution_dir = os.path.join(settings.SITE_ROOT, '..', 'constitutions') … … 214 205 reversion.register(GroupConstitution) 215 206 207 GROUP_STARTUP_STAGE_SUBMITTED = 10 208 GROUP_STARTUP_STAGE_APPROVED = 20 209 GROUP_STARTUP_STAGE_REJECTED = -10 210 GROUP_STARTUP_STAGE = ( 211 (GROUP_STARTUP_STAGE_SUBMITTED, 'submitted'), 212 (GROUP_STARTUP_STAGE_APPROVED, 'approved'), 213 (GROUP_STARTUP_STAGE_REJECTED, 'rejected'), 214 ) 215 216 216 217 217 class GroupStartup(models.Model): -
asadb/groups/views.py
r4368c00 r58a5c6a 93 93 roles.append((role.display_name, role, group.officers(role=role), )) 94 94 context['roles'] = roles 95 context['my_roles'] = group.officers(person=self.request.user.username).select_related('role') 95 context['my_roles'] = [] 96 if self.request.user.is_authenticated(): 97 context['my_roles'] = group.officers(person=self.request.user.username).select_related('role') 96 98 97 99 return context -
asadb/media/style/style.css
rbb48649 r078e53a 223 223 tr.private-info th:before 224 224 { 225 content: " *";225 content: "\2020 "; 226 226 } 227 227 -
asadb/settings.py
ra86a924 r05f5712 83 83 ) 84 84 85 TEMPLATE_CONTEXT_PROCESSORS = ( 86 "django.core.context_processors.auth", 87 "django.core.context_processors.debug", 88 "django.core.context_processors.i18n", 89 "django.core.context_processors.media", 90 "django.core.context_processors.request", 91 ) 92 85 93 MIDDLEWARE_CLASSES = [ 86 94 'django.middleware.common.CommonMiddleware', -
asadb/template/about/index.html
rb926df6 r3437855 1 1 {% extends "base.html" %} 2 2 3 {% block title %} About{% endblock %}3 {% block title %}Help & About{% endblock %} 4 4 {% block content %} 5 5 6 <h1> About</h1>6 <h1>Help & About</h1> 7 7 8 8 <p>The ASA Group Database is provided principally for the use of the ASA Executive Board, MIT student group officers, current and potential group members, and MIT offices supporting those groups.</p> 9 9 10 <p>To contact the Association of Student Activities, please see <a href='http://web.mit.edu/asa/about/contact-info.html'>our contact information</a>. For issues directly about the ASA Group Database, please contact the database team at <a href='mailto:asa-db@mit.edu'>asa-db@mit.edu</a>. </p>10 <p>To contact the Association of Student Activities, please see <a href='http://web.mit.edu/asa/about/contact-info.html'>our contact information</a>. For issues directly about the ASA Group Database, please contact the database team at <a href='mailto:asa-db@mit.edu'>asa-db@mit.edu</a>. Make sure to <em>include your group's name</em>, and preferably a link to your group's database page. If you're following up on an email from us or the database, please make sure to <em>quote the original message</em>.</p> 11 11 12 <p>See also :</p>12 <p>See also the following pages on the ASA website:</p> 13 13 14 14 <ul> 15 <li><a href='{% url about-data %}'>Use of Data</a></li> 16 <li><a href='http://web.mit.edu/asa/database/account-numbers.html'>Information on visibility of account numbers</a> (on the ASA website)</li> 15 <li><a href='http://web.mit.edu/asa/database/faq.html'>Frequently Asked Questions</a></li> 16 <li><a href='http://web.mit.edu/asa/database/account-numbers.html'>Information on visibility of account numbers</a></li> 17 <li><a href='http://web.mit.edu/asa/database/use-of-data.html'>Use of Data</a></li> 17 18 </ul> 18 19 -
asadb/template/base.html
rd5631bc rcec082b 14 14 <li{% ifequal pagename "groups" %} class='selected'{% endifequal %}><a href="{% url groups:list %}">Groups</a></li> 15 15 <li{% ifequal pagename "fysm" %} class='selected'{% endifequal %}><a href="{% url fysm %}">FYSM</a></li> 16 <li{% ifequal pagename "about" %} class='selected'{% endifequal %}><a href="{% url about %}"> About</a></li>16 <li{% ifequal pagename "about" %} class='selected'{% endifequal %}><a href="{% url about %}">Help & About</a></li> 17 17 {% if user.is_staff %}<li><a href='{% url admin:index %}'>Admin</a></li>{% endif %} 18 18 </ul> … … 29 29 {% else %} 30 30 <p>You are not logged in.</p> 31 <p><a href='{% url login %} '>Login</a></p>31 <p><a href='{% url login %}?next={% firstof request.path '/' %}'>Login</a></p> 32 32 {% endif %} 33 33 </div> -
asadb/template/groups/diffs/asa-official-update.txt
rea217bd r74e9f09 14 14 {% for email in delete %}{{email}} 15 15 {% endfor %} 16 17 Notes: 18 {% for note in notes %}{{note}} 19 {% empty %}No notes. 20 {% endfor %} 16 21 {% endautoescape %} -
asadb/template/groups/diffs/asa-update-mail.txt
rb6c7a44 r8254020 1 1 {% autoescape off %} 2 2 Hi ASA Exec, 3 The following {{num_groups}} groups have updated their information recently. In addition, {{ num_signatory_records}} signatory updates (of types you care about) have occurred.3 The following {{num_groups}} groups have updated their information recently. In addition, {{care_about}} signatory updates (of types you care about) have occurred. 4 4 5 5 In total, the following signatory updates by type have occurred: 6 Added: {{signatory_type_counts.Added}} 7 Expired: {{signatory_type_counts.Expired}} 6 {{change_stats}} 8 7 9 8 Thanks, -
asadb/template/groups/diffs/sao-update-mail.txt
r927c824 r8254020 1 1 {% autoescape off %} 2 2 Hi SAO, 3 The following {{ num_signatory_records}} signatory updates (of types you care about) have occurred. In addition, since we're sending mail anyway, the following {{num_groups}} groups have updated their information recently.3 The following {{care_about}} signatory updates (of types you care about) have occurred. In addition, since we're sending mail anyway, the following {{num_groups}} groups have updated their information recently. 4 4 5 5 In total, the following signatory updates by type have occurred: 6 Added: {{signatory_type_counts.Added}} 7 Expired: {{signatory_type_counts.Expired}} 6 {{change_stats}} 8 7 9 8 Thanks, -
asadb/template/groups/group_change_officers.html
r0270ed7 rbbaf690 8 8 {% include "groups/group_tools.part.html" %} 9 9 10 <p>Please adjust your signatories below. You can add up to {{max_new}} new people at a time at the bottom. If you need to add more than that, just break it up into a couple of submissions.</p> 11 12 <p>The following roles are available:</p> 10 <p>Please adjust your signatories below. The following roles are available:</p> 13 11 14 12 <table class='pretty-table'> … … 54 52 {% endif %} 55 53 56 <p>Add or update people:</p> 54 <p>Add or update people. Please note:</p> 55 <ul> 56 <li>We don't track "group membership" — people will show up in the list below only if they have one of the roles listed</li> 57 <li>Type only the <em>Athena username</em> to add people — do not type full names or names plus username</li> 58 <li>To add <em>more than four</em> new people, add four at a time and <em>submit multiple times</em></li> 59 </ul> 57 60 58 61 <form enctype="multipart/form-data" method="post" action=""> -
asadb/template/groups/group_detail.html
r41f8b1e r58a5c6a 6 6 <h1>{{group.name}}{% if group.abbreviation %} ({{group.abbreviation}}){%endif%}</h1> 7 7 8 {% if adminpriv %}{% include "groups/group_tools.part.html" %}{%endif%} 8 {% if adminpriv %}{% include "groups/group_tools.part.html" %} 9 {% else %} 10 <div class='toolbox'> 11 <h2>Tools</h2> 12 {% if user.is_authenticated %} 13 <p>You are not an admin of this group.</p> 14 <p><a href='http://web.mit.edu/asa/database/faq.html#perm'>See FAQ</a> for more info.</p> 15 {% else %} 16 <p>No tools available without <a href='{% url login %}?next={% firstof request.path '/' %}'>logging in</a>.</p> 17 {% endif %} 18 </div> 19 {% endif %} 9 20 10 21 <table class='pretty-table'> … … 21 32 <tr><th>Website</th><td><a href="{{group.website_url}}">{{group.website_url}}</a></td></tr> 22 33 <tr><th>Meeting times</th><td>{{group.meeting_times}}</td></tr> 23 <tr><th>Officer email</th><td>{% if user.is_authenticated %}{{group.officer_email}}{% else %}[<a href='{% url login%}'>log in</a> to see emails]{% endif %}</td></tr>34 <tr><th>Officers' email list</th><td>{% if user.is_authenticated %}{{group.officer_email}}{% else %}[<a href='{% url login %}?next={% firstof request.path '/' %}'>log in</a> to see emails]{% endif %}</td></tr> 24 35 {% if viewpriv %}<tr class='private-info'> 25 <th>Group email </th>36 <th>Group email list</th> 26 37 <td>{{group.group_email}}</td> 27 38 </tr>{% endif %} … … 30 41 {% if user.is_authenticated %} 31 42 {% for name, role, people in roles %} 32 <tr >33 <th>{{name}} {%if not role.publicly_visible %}*{%endif%}</th>43 <tr{%if not role.publicly_visible %} class='private-info'{%endif%}> 44 <th>{{name}}</th> 34 45 <td><ul> 35 46 {% for person in people %}<li>{{person.format_person}}</li>{%endfor%} … … 38 49 {% endfor %} 39 50 {% else %} 40 <tr><td colspan='2'>[<a href='{% url login %} '>log in</a> to see people involved]</td></tr>51 <tr><td colspan='2'>[<a href='{% url login %}?next={% firstof request.path '/' %}'>log in</a> to see people involved]</td></tr> 41 52 {% endif %} 42 53 … … 106 117 </table> 107 118 {% else %} 119 {% if user.is_authenticated %} 108 120 <p>No roles in this group.</p> 121 {% else %} 122 <p><a href='{% url login %}?next={% firstof request.path '/' %}'>Log in</a> to see any roles in this group.</p> 123 {% endif %} 109 124 {% endif %} 110 125 -
asadb/template/groups/letters/missing-transition.txt
r2a587e4 r7a56298 1 1 {% autoescape off %} 2 Hello again, 3 As a reminder, you have only a couple of days (until Wed 3/21) to update 4 the ASA group database before we suspend your group for delinquency. Please 5 be sure to visit https://asa.mit.edu:444/groups/{{group.pk}}/. If your 6 president is not available to make this update, please email us 7 (asa-exec@mit.edu) ASAP, CC'ing your officers' list of record (check the To 8 line of this email). If you have other questions/difficulties, please don't 9 hesitate to contact asa-exec@mit.edu. 10 11 Thanks, 12 ASA Executive Board 13 14 ==== 15 2 16 Dear officers of {{group.name}}, 3 We believe that you have not yet fully updated your entry in the new ASA Group Database. As we have said previously (e.g., in an email to asa-official@mit.edu on 1/23/2012), the ASA is transitioning to a new database. As part of this transition, groups are responsible for inputting most of their group's information to ensure that it is up-to-date. MIT offices will be starting to use the new database now. It is critical to your group's ability to continue making financial transactions and reserving space that you list your signatories soon. Additionally, without updating basic information such as officer's email, the ASA will be unable to keep you updated on important news like midway, funding, and application deadlines. 17 This is a followup to our previous email from a couple of weeks ago. 18 You have still not updated your entry in the ASA Database. We have gotten 19 complaints from some MIT offices (e.g., Schedules) that this is delaying 20 their work, and it also interferes with our own work. 4 21 5 More information about accessing and using the new Database and which fields need to be updated is posted at: http://web.mit.edu/asa/database/. 22 *We will suspend* groups that haven't updated their records --- both main info 23 and listed people --- by Wednesday 3/21, unless they have contacted us at 24 asa-exec@mit.edu about difficulties doing so. Further penalties may follow 25 thereafter. 26 27 Offices (e.g., SAO, CAC, and Schedules) are already stopping checking 28 the old database for signatories. It's to your advantage to update the 29 database *before* you attempt to spend money, reserve spaces, and perform 30 other functions that will block on your not having updated the database. 31 32 More information about accessing and using the new Database and which 33 fields need to be updated is posted at: http://web.mit.edu/asa/database/. 6 34 7 35 Your group's page can be found at https://asa.mit.edu/groups/{{group.pk}}/. 36 8 37 9 38 In particular, we believe that your group's entry has the following issues: … … 11 40 {% endfor %} 12 41 13 We appreciate you cooperation in fixing these quickly. If you believe this message to be in error, please be sure to contact us at asa-exec@mit.edu.14 15 If you have questions, comments, concerns, or suggestions for improving the new database, please let us know.42 We appreciate your cooperation in fixing these quickly. If you believe 43 this message to be in error, please be sure to contact us at 44 asa-exec@mit.edu. 16 45 17 46 Thanks, -
asadb/urls.py
rb926df6 r78c94e7 15 15 url( 16 16 r'^data/$', 17 'django.views.generic.simple. direct_to_template',18 {' template': 'about/data.html', 'extra_context': { 'pagename':'about' },},17 'django.views.generic.simple.redirect_to', 18 {'url': 'http://web.mit.edu/asa/database/use-of-data.html'}, 19 19 name='about-data', 20 20 ), -
docs/deploy.txt
r65c0a28 rc4255b2 1 1 Deploying a new version of the ASA database: 2 * Skim the changes (git log stable..master) and verify they're reasonable to deploy 2 * Skim the changes (git log stable..master) 3 * verify they're reasonable to deploy 4 * make sure any Trac tickets (http://asa.scripts.mit.edu/trac/query) have been marked resolved if applicable 3 5 * Draft email to asa-db-core-stakeholders 4 6 git log --oneline stable..master
Note: See TracChangeset
for help on using the changeset viewer.