added try-except to sort function
This commit is contained in:
parent
4c16afebf9
commit
2ff8027d34
@ -474,7 +474,9 @@ if __name__ == "__main__":
|
||||
a = f_cfg["internal-avatars"]["local_path_to_avatars"]
|
||||
b = f_cfg["internal-avatars"]["path_to_avatars"]
|
||||
get_avatars(list_of_json_objs, a, b)
|
||||
list_of_json_objs.sort(key=lambda e: e["last-updated"], reverse=True)
|
||||
try:
|
||||
list_of_json_objs.sort(key=lambda e: e["last-updated"], reverse=True)
|
||||
except KeyError: pass
|
||||
return render(list_of_json_objs, f_cfg["format"])
|
||||
|
||||
def main():
|
||||
|
Loading…
x
Reference in New Issue
Block a user