[FIX] website_event_track: Properly sort tracks on website with P3

On Python 3, dict.keys() doesn't return a list, so we can't sort it, but
converting to a list on the fly before calling to sort() is not going to
change the original dict_keys object. Storing directly the list in the
variable, we get the expected result.

Side note: the daylist2 variable is there just for the t-set and was
already present in the code. Renaming it to dummy would be clearer
but that should not be done in stable.

Closes #25113.
This commit is contained in:
Pedro M. Baeza
2018-06-11 12:03:38 +02:00
committed by Thibault Delavallée
parent e2ea066360
commit 1bf483b047
@@ -50,8 +50,8 @@
<input type="text" class="form-control" placeholder="Filter Tracks..." id="event_track_search"/>
</div>
</section>
<t t-set="dayslist" t-value="days.keys()"/>
<t t-set="dayslist2" t-value="list(dayslist).sort()"/> <!-- display days in the right order -->
<t t-set="dayslist" t-value="list(days.keys())"/>
<t t-set="dayslist2" t-value="dayslist.sort()"/> <!-- display days in the right order -->
<section class="container" t-foreach="dayslist" t-as="day">
<t t-set="locations" t-value="days[day]['locations']"/>
<t t-set="dates" t-value="days[day]['dates']"/>