Skip to content

Commit

Permalink
Put altering of accepted suggestion in a separate timeline entry
Browse files Browse the repository at this point in the history
  • Loading branch information
ta2-1 committed Apr 22, 2016
1 parent 78b6482 commit c2d984e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
10 changes: 9 additions & 1 deletion pootle/apps/pootle_store/unit/timeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,15 @@ def get_grouped_entries(self):
grouped_entries = []
grouped_timeline = groupby(
self.submissions,
key=lambda x: ("%d\001%s" % (x['submitter_id'], x['creation_time'])))
key=lambda item: "\001".join([
str(x) for x in
[
item['submitter_id'],
item['creation_time'],
item['suggestion_id'],
]
])
)
# Group by submitter id and creation_time because
# different submissions can have same creation time
for key, values in grouped_timeline:
Expand Down
10 changes: 9 additions & 1 deletion tests/views/timeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,15 @@ def _calculate_timeline(request, unit):

grouped_timeline = groupby(
timeline.values(*timeline_fields),
key=lambda x: ("%d\001%s" % (x['submitter_id'], x['creation_time'])))
key=lambda item: "\001".join([
str(x) for x in
[
item['submitter_id'],
item['creation_time'],
item['suggestion_id'],
]
])
)

# Group by submitter id and creation_time because
# different submissions can have same creation time
Expand Down

0 comments on commit c2d984e

Please sign in to comment.