Changeset 8cf11c9


Ignore:
Timestamp:
Feb 6, 2012, 4:10:36 AM (14 years ago)
Author:
Alex Dehnert <adehnert@…>
Branches:
master, space-access, stable, stage
Children:
ffdfde5
Parents:
1aaa525
git-author:
Alex Dehnert <adehnert@…> (02/06/12 04:10:36)
git-committer:
Alex Dehnert <adehnert@…> (02/06/12 04:10:36)
Message:

Only warn groups if they lack something we need

We don't actually require that groups have a financial or reservation
signatory, so don't email them if that's all they're missing.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • asadb/groups/find_missing_transition.py

    r1aaa525 r8cf11c9  
    1818def get_roles():
    1919    roles = [
    20         ['treasurer', 'No treasurer listed', ],
    21         ['financial', 'No financial signatories listed. At minimum, this should generally be your president and treasurer.', ],
    22         ['reservation', 'No reservation signatories listed. Members reserving space for the group should be reservation signatories.', ],
     20        ['treasurer', True, 'No treasurer listed', ],
     21        ['financial', False, 'No financial signatories listed. At minimum, this should generally be your president and treasurer.', ],
     22        ['reservation', False, 'No reservation signatories listed. Members reserving space for the group should be reservation signatories.', ],
    2323    ]
    2424    for role in roles:
     
    2929def check_group(group, roles, ):
    3030    problems = []
     31    fail = False
    3132    if group.officer_email or group.description:
    3233        pass
    3334    else:
    3435        problems.append("No basic group information listed")
    35     for role, msg in roles:
     36        fail = True
     37    for role, cause_fail, msg in roles:
    3638        if len(group.officers(role=role)) == 0:
    3739            problems.append(msg)
    38     return problems
     40            if cause_fail: fail = True
     41    return fail, problems
    3942
    4043def officers_lists(fd, ):
     
    5255    emails = []
    5356    for group in groups.models.Group.active_groups.all():
    54         problems = check_group(group, roles, )
    55         if problems:
     57        fail, problems = check_group(group, roles, )
     58        if fail:
    5659            to = [officers[group.pk]]
    5760            if group.officer_email:
Note: See TracChangeset for help on using the changeset viewer.