Changeset 9a30b56


Ignore:
Timestamp:
Mar 16, 2012, 5:46:59 AM (14 years ago)
Author:
Alex Dehnert <adehnert@…>
Branches:
master, space-access, stable, stage
Children:
8254020
Parents:
74e9f09
git-author:
Alex Dehnert <adehnert@…> (03/16/12 05:46:08)
git-committer:
Alex Dehnert <adehnert@…> (03/16/12 05:46:59)
Message:

Fix off-by-one error in groups/diffs.py summaries

As a bonus, makes the code simpler... Though that's not totally a coincidence.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • asadb/groups/diffs.py

    r74e9f09 r9a30b56  
    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        }
    6464        self.since = since
     
    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
    9188            if signatory.role.slug in self.interesting_signatories:
    9289                if signatory.group != prev_group:
Note: See TracChangeset for help on using the changeset viewer.