added try-except to sort function

This commit is contained in:
likho 2023-09-30 09:53:57 -07:00
parent 4c16afebf9
commit 2ff8027d34

View File

@ -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)
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():