Skip to content

Commit

Permalink
Put target field timeline entry first (before state field)
Browse files Browse the repository at this point in the history
  • Loading branch information
ta2-1 committed May 13, 2016
1 parent 891f21f commit ed7dc17
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pootle/apps/pootle_store/unit/timeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,10 +303,16 @@ def get_grouped_entries(self):
]
])
)

# Target field timeline entry should go first
def target_field_should_be_first(x):
return 0 if x["field"] == SubmissionFields.TARGET else 1

# Group by submitter id and creation_time because
# different submissions can have same creation time
for key, values in grouped_timeline:
entry_group = {'entries': []}
values = sorted(values, key=target_field_should_be_first)
for item in values:
if "submitter" not in entry_group:
entry_group['submitter'] = DisplayUser(
Expand Down

0 comments on commit ed7dc17

Please sign in to comment.