Changeset 08b7660


Ignore:
Timestamp:
Nov 29, 2013, 12:09:08 AM (12 years ago)
Author:
Alex Dehnert <adehnert@…>
Branches:
master, stable, stage
Children:
a526ed2
Parents:
beb46fb
git-author:
Alex Dehnert <adehnert@…> (11/29/13 00:09:08)
git-committer:
Alex Dehnert <adehnert@…> (11/29/13 00:09:08)
Message:

Memberships: refactor issues.csv slightly

File:
1 edited

Legend:

Unmodified
Added
Removed
  • asadb/forms/views.py

    rbeb46fb r08b7660  
    527527    output.writerow(fields)
    528528
     529    def output_issue(group, issue, num_confirms):
     530        fields = [
     531            group.id,
     532            group.name,
     533            issue,
     534            num_confirms,
     535            group.officer_email,
     536        ]
     537        if account_numbers: fields.append(group.main_account_id)
     538        output.writerow(fields)
     539
    529540    q_present = Q(id__in=group_updates.values('group'))
    530541    missing_groups = active_groups.filter(~q_present)
     
    532543    for group in missing_groups:
    533544        num_confirms = len(people_confirmations.filter(groups=group))
    534         fields = [
    535             group.id,
    536             group.name,
    537             'unsubmitted',
    538             num_confirms,
    539             group.officer_email,
    540         ]
    541         if account_numbers: fields.append(group.main_account_id)
    542         output.writerow(fields)
     545        output_issue(group, 'unsubmitted', num_confirms)
    543546
    544547    for group_update in group_updates:
     
    556559
    557560        for problem in problems:
    558             fields = [
    559                 group.id,
    560                 group.name,
    561                 problem,
    562                 num_confirms,
    563                 group.officer_email,
    564             ]
    565             if account_numbers: fields.append(group.main_account_id)
    566             output.writerow(fields)
    567 
     561            output_issue(group, problem, num_confirms)
    568562
    569563    return HttpResponse(buf.getvalue(), mimetype='text/csv', )
Note: See TracChangeset for help on using the changeset viewer.