From c2d984e605b73aa7fa3c0d7ddc7e7bea05b04dd6 Mon Sep 17 00:00:00 2001 From: Taras Semenenko Date: Fri, 22 Apr 2016 02:06:23 +0300 Subject: [PATCH] Put altering of accepted suggestion in a separate timeline entry --- pootle/apps/pootle_store/unit/timeline.py | 10 +++++++++- tests/views/timeline.py | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/pootle/apps/pootle_store/unit/timeline.py b/pootle/apps/pootle_store/unit/timeline.py index 7bf5f23c9f2..19d0ec20b2a 100644 --- a/pootle/apps/pootle_store/unit/timeline.py +++ b/pootle/apps/pootle_store/unit/timeline.py @@ -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: diff --git a/tests/views/timeline.py b/tests/views/timeline.py index 4843692f8d4..8f4f40403b9 100644 --- a/tests/views/timeline.py +++ b/tests/views/timeline.py @@ -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