Fix transfer sort
This commit is contained in:
parent
e6735d44ba
commit
a1c976185c
2 changed files with 5 additions and 8 deletions
|
@ -635,8 +635,8 @@ class HistoryGroup extends ModelObject {
|
|||
*/
|
||||
static compare(a, b) {
|
||||
//Groups are sorted by most recent first
|
||||
if (a.at < b.at) return 1;
|
||||
else if (a.at > b.at) return -1;
|
||||
if (a.at.isBefore(b.at)) return 1;
|
||||
else if (a.at.isAfter(b.at)) return -1;
|
||||
else return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -1502,6 +1502,7 @@ def history_json(request):
|
|||
'id': transfergroup.at.strftime('%Y%m%d'),
|
||||
'date': transfergroup.at
|
||||
},
|
||||
'child_sort': 'transfergroup',
|
||||
},
|
||||
'children': [],
|
||||
}
|
||||
|
@ -1604,14 +1605,10 @@ class SettingsUpdate(SuccessMessageMixin, UpdateView):
|
|||
# Transfer views
|
||||
# -----
|
||||
|
||||
|
||||
@teamkfet_required
|
||||
def transfers(request):
|
||||
transfergroups = (TransferGroup.objects
|
||||
.prefetch_related('transfers')
|
||||
.order_by('-at'))
|
||||
return render(request, 'kfet/transfers.html', {
|
||||
'transfergroups': transfergroups,
|
||||
})
|
||||
return render(request, 'kfet/transfers.html')
|
||||
|
||||
@teamkfet_required
|
||||
def transfers_create(request):
|
||||
|
|
Loading…
Reference in a new issue