From 06a6a0a33283af53c4423084e4a0881f4436b350 Mon Sep 17 00:00:00 2001 From: Brian Candler Date: Wed, 15 Apr 2020 09:41:50 +0100 Subject: [PATCH] Sort snapshots by (created_at, name) Fixes #1739 --- gns3server/handlers/api/controller/snapshot_handler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gns3server/handlers/api/controller/snapshot_handler.py b/gns3server/handlers/api/controller/snapshot_handler.py index 513bbe3e..e4008ee9 100644 --- a/gns3server/handlers/api/controller/snapshot_handler.py +++ b/gns3server/handlers/api/controller/snapshot_handler.py @@ -64,7 +64,7 @@ class SnapshotHandler: controller = Controller.instance() project = controller.get_project(request.match_info["project_id"]) snapshots = [s for s in project.snapshots.values()] - response.json(sorted(snapshots, key=lambda s: s.created_at)) + response.json(sorted(snapshots, key=lambda s: (s.created_at, s.name))) @Route.delete( r"/projects/{project_id}/snapshots/{snapshot_id}",