Changes in / [a53f8ee:05f5712]


Ignore:
Files:
1 added
1 deleted
17 edited

Legend:

Unmodified
Added
Removed
  • asadb/groups/diffs.py

    r80a8145 rb2cee30  
    5959        self.signatory_updates = []
    6060        self.signatory_type_counts = {
    61             'Added': {},
    62             'Expired': {},
     61            'Added': collections.defaultdict(lambda: 0),
     62            'Expired': collections.defaultdict(lambda: 0),
    6363        }
     64        self.signatory_types_seen = set()
    6465        self.since = since
    6566        self.now = now
    66         self.stats = collections.defaultdict(lambda: 0)
    6767
    6868    def handle_group(self, before, after, before_fields, after_fields, ):
     
    8585                change_type = "Expired"
    8686            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)
    9189            if signatory.role.slug in self.interesting_signatories:
    9290                if signatory.group != prev_group:
     
    103101                prev_group = signatory.group
    104102            else:
    105                 self.stats["role." + signatory.role.slug] += 1
     103                pass
    106104                #print "Ignoring role %s (signatory %s)" % (signatory.role.slug, signatory, )
    107105
     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
    108139    def end_run(self, ):
     140        change_stats, care_about = self.build_change_stats()
    109141        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
    113143
    114144        message = "\n\n".join(self.updates)
     
    122152            'num_groups': len(self.updates),
    123153            'groups_message': message,
    124             'num_signatory_records': len(self.signatory_updates),
     154            'care_about': care_about,
     155            'change_stats': change_stats,
    125156            'signatory_types': self.interesting_signatories,
    126             'signatory_type_counts': self.signatory_type_counts,
    127157            'signatories_message': signatories_message,
    128158        })
     
    144174        self.add = []
    145175        self.delete = []
     176        self.notes = []
    146177
    147178    def end_run(self, ):
     
    156187                'delete': self.delete,
    157188                'errors': errors,
     189                'notes': self.notes,
    158190            }
    159191            util.emails.email_from_template(
     
    164196
    165197    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:
    167201            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, ))
    170211
    171212    def new_group(self, after, after_fields, ):
     
    250291    qobj_expired = Q(end_time__lte=now, start_time__lte=since, end_time__gte=since)
    251292    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', )
    253294    changed_signatories = changed_signatories.select_related('role', 'group')
    254295    for callback in callbacks: callback.handle_signatories(changed_signatories)
  • asadb/groups/find_missing_transition.py

    r2a587e4 r0dc771d  
    1818def get_roles():
    1919    roles = [
     20        ['president', True, 'No president listed', ],
    2021        ['treasurer', True, 'No treasurer listed', ],
    2122        ['financial', False, 'No financial signatories listed. At minimum, this should generally be your president and treasurer.', ],
     
    6263        fail, problems = check_group(group, roles, )
    6364        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, )
    6569            if group.officer_email:
    6670                to.append(group.officer_email)
     
    8185    connection = mail.get_connection()
    8286    #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
    8490    print len(emails)
    8591
  • asadb/groups/load_people.py

    rdc81a9e r2538f75  
    137137Initial in Django:  %(django_people)6d
    138138People in DCM:      %(dcm_people)6d
     139Already Deleted:    %(pre_del)6d
     140Unchanged:          %(unchanged)6d
    139141Changed:            %(changed)6d
    140142Change ignored:     %(mut_ign)6d
    141 Unchanged:          %(unchanged)6d
    142143Deleted:            %(del)6d
    143 Already Deleted:    %(pre_del)6d
    144144Undeleted:          %(undel)6d
    145 Added:              %(add)6d""" % stats
     145Added:              %(add)6d
     146""" % stats
    146147
    147148    for change_type, people in stat_people.items():
  • asadb/groups/models.py

    rf8bd496 rfd5cc07  
    4242    main_account_id = models.IntegerField(null=True, blank=True, )
    4343    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.")
    4545    recognition_date = models.DateTimeField()
    4646    update_date = models.DateTimeField(editable=False, )
     
    112112reversion.register(Group)
    113113
    114 
    115 GROUP_STARTUP_STAGE_SUBMITTED = 10
    116 GROUP_STARTUP_STAGE_APPROVED = 20
    117 GROUP_STARTUP_STAGE_REJECTED = -10
    118 GROUP_STARTUP_STAGE = (
    119     (GROUP_STARTUP_STAGE_SUBMITTED,     'submitted'),
    120     (GROUP_STARTUP_STAGE_APPROVED,      'approved'),
    121     (GROUP_STARTUP_STAGE_REJECTED,      'rejected'),
    122 )
    123114
    124115constitution_dir = os.path.join(settings.SITE_ROOT, '..', 'constitutions')
     
    214205reversion.register(GroupConstitution)
    215206
     207GROUP_STARTUP_STAGE_SUBMITTED = 10
     208GROUP_STARTUP_STAGE_APPROVED = 20
     209GROUP_STARTUP_STAGE_REJECTED = -10
     210GROUP_STARTUP_STAGE = (
     211    (GROUP_STARTUP_STAGE_SUBMITTED,     'submitted'),
     212    (GROUP_STARTUP_STAGE_APPROVED,      'approved'),
     213    (GROUP_STARTUP_STAGE_REJECTED,      'rejected'),
     214)
     215
    216216
    217217class GroupStartup(models.Model):
  • asadb/groups/views.py

    r4368c00 r58a5c6a  
    9393            roles.append((role.display_name, role, group.officers(role=role), ))
    9494        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')
    9698
    9799        return context
  • asadb/media/style/style.css

    rbb48649 r078e53a  
    223223tr.private-info th:before
    224224{
    225     content: "* ";
     225    content: "\2020 ";
    226226}
    227227
  • asadb/settings.py

    ra86a924 r05f5712  
    8383)
    8484
     85TEMPLATE_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
    8593MIDDLEWARE_CLASSES = [
    8694    'django.middleware.common.CommonMiddleware',
  • asadb/template/about/index.html

    rb926df6 r3437855  
    11{% extends "base.html" %}
    22
    3 {% block title %}About{% endblock %}
     3{% block title %}Help & About{% endblock %}
    44{% block content %}
    55
    6 <h1>About</h1>
     6<h1>Help &amp; About</h1>
    77
    88<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>
    99
    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>
    1111
    12 <p>See also:</p>
     12<p>See also the following pages on the ASA website:</p>
    1313
    1414<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>
    1718</ul>
    1819
  • asadb/template/base.html

    rd5631bc rcec082b  
    1414        <li{% ifequal pagename "groups"   %} class='selected'{% endifequal %}><a href="{% url groups:list %}">Groups</a></li>
    1515        <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 &amp; About</a></li>
    1717        {% if user.is_staff %}<li><a href='{% url admin:index %}'>Admin</a></li>{% endif %}
    1818    </ul>
     
    2929            {% else %}
    3030                <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>
    3232            {% endif %}
    3333        </div>
  • asadb/template/groups/diffs/asa-official-update.txt

    rea217bd r74e9f09  
    1414{% for email in delete %}{{email}}
    1515{% endfor %}
     16
     17Notes:
     18{% for note in notes %}{{note}}
     19{% empty %}No notes.
     20{% endfor %}
    1621{% endautoescape %}
  • asadb/template/groups/diffs/asa-update-mail.txt

    rb6c7a44 r8254020  
    11{% autoescape off %}
    22Hi 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.
    44
    55In total, the following signatory updates by type have occurred:
    6 Added: {{signatory_type_counts.Added}}
    7 Expired: {{signatory_type_counts.Expired}}
     6{{change_stats}}
    87
    98Thanks,
  • asadb/template/groups/diffs/sao-update-mail.txt

    r927c824 r8254020  
    11{% autoescape off %}
    22Hi 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.
    44
    55In total, the following signatory updates by type have occurred:
    6 Added: {{signatory_type_counts.Added}}
    7 Expired: {{signatory_type_counts.Expired}}
     6{{change_stats}}
    87
    98Thanks,
  • asadb/template/groups/group_change_officers.html

    r0270ed7 rbbaf690  
    88{% include "groups/group_tools.part.html" %}
    99
    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>
    1311
    1412<table class='pretty-table'>
     
    5452{% endif %}
    5553
    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" &mdash; 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 &mdash; 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>
    5760
    5861<form enctype="multipart/form-data" method="post" action="">
  • asadb/template/groups/group_detail.html

    r41f8b1e r58a5c6a  
    66<h1>{{group.name}}{% if group.abbreviation %} ({{group.abbreviation}}){%endif%}</h1>
    77
    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 %}
    920
    1021<table class='pretty-table'>
     
    2132<tr><th>Website</th><td><a href="{{group.website_url}}">{{group.website_url}}</a></td></tr>
    2233<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>
    2435{% if viewpriv %}<tr class='private-info'>
    25     <th>Group email</th>
     36    <th>Group email list</th>
    2637    <td>{{group.group_email}}</td>
    2738</tr>{% endif %}
     
    3041{% if user.is_authenticated %}
    3142{% 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>
    3445    <td><ul>
    3546    {% for person in people %}<li>{{person.format_person}}</li>{%endfor%}
     
    3849{% endfor %}
    3950{% 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>
    4152{% endif %}
    4253
     
    106117</table>
    107118{% else %}
     119{% if user.is_authenticated %}
    108120<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 %}
    109124{% endif %}
    110125
  • asadb/template/groups/letters/missing-transition.txt

    r2a587e4 r7a56298  
    11{% autoescape off %}
     2Hello again,
     3   As a reminder, you have only a couple of days (until Wed 3/21) to update
     4the ASA group database before we suspend your group for delinquency. Please
     5be sure to visit https://asa.mit.edu:444/groups/{{group.pk}}/. If your
     6president 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
     8line of this email). If you have other questions/difficulties, please don't
     9hesitate to contact asa-exec@mit.edu.
     10
     11Thanks,
     12ASA Executive Board
     13
     14====
     15
    216Dear 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.
     18You have still not updated your entry in the ASA Database. We have gotten
     19complaints from some MIT offices (e.g., Schedules) that this is delaying
     20their work, and it also interferes with our own work.
    421
    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
     23and listed people --- by Wednesday 3/21, unless they have contacted us at
     24asa-exec@mit.edu about difficulties doing so. Further penalties may follow
     25thereafter.
     26
     27Offices (e.g., SAO, CAC, and Schedules) are already stopping checking
     28the old database for signatories. It's to your advantage to update the
     29database *before* you attempt to spend money, reserve spaces, and perform
     30other functions that will block on your not having updated the database.
     31
     32More information about accessing and using the new Database and which
     33fields need to be updated is posted at: http://web.mit.edu/asa/database/.
    634
    735Your group's page can be found at https://asa.mit.edu/groups/{{group.pk}}/.
     36
    837
    938In particular, we believe that your group's entry has the following issues:
     
    1140{% endfor %}
    1241
    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.
     42We appreciate your cooperation in fixing these quickly. If you believe
     43this message to be in error, please be sure to contact us at
     44asa-exec@mit.edu.
    1645
    1746Thanks,
  • asadb/urls.py

    rb926df6 r78c94e7  
    1515    url(
    1616        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'},
    1919        name='about-data',
    2020    ),
  • docs/deploy.txt

    r65c0a28 rc4255b2  
    11Deploying 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
    35* Draft email to asa-db-core-stakeholders
    46    git log --oneline stable..master
Note: See TracChangeset for help on using the changeset viewer.