fix order of devices

This commit is contained in:
Cayo Puigdefabregas 2023-03-08 17:22:26 +01:00
parent 54372ad2f9
commit 40a151df5a
1 changed files with 7 additions and 1 deletions

View File

@ -1102,6 +1102,12 @@ class ExportsView(View):
if "Failed" in [e.severity.get_public_name() for e in erasures]:
result = 'Failed'
erasures = sorted(erasures, key=lambda x: x.end_time)
erasures_on_server = sorted(erasures_on_server, key=lambda x: x.end_time)
erasures_host = sorted(erasures_host, key=lambda x: x.end_time)
erasures_normal = list(set(erasures) - set(erasures_on_server))
erasures_normal = sorted(erasures_normal, key=lambda x: x.end_time)
params = {
'title': 'Erasure Certificate',
'erasures': tuple(erasures),
@ -1114,7 +1120,7 @@ class ExportsView(View):
'result': result,
'customer_details': customer_details,
'erasure_hosts': erasures_host,
'erasures_normal': list(set(erasures) - set(erasures_on_server)),
'erasures_normal': erasures_normal,
}
return flask.render_template('inventory/erasure.html', **params)