From d405dfb211fa776220cccfc0585c0d0591980fb9 Mon Sep 17 00:00:00 2001
From: Christian Heller <c.heller@plomlompom.de>
Date: Sun, 9 Feb 2025 09:23:19 +0100
Subject: [PATCH] Restore alphabetical sorting of account names.

---
 src/run.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/run.py b/src/run.py
index b3e2c5c..abd1709 100755
--- a/src/run.py
+++ b/src/run.py
@@ -487,7 +487,7 @@ class Handler(PlomHttpHandler):
         ctx['valid'] = 0 == len([b for b in to_balance if b.is_questionable])
         ctx['roots'] = observed_tree
         if not raw:
-            ctx['all_accounts'] = accounts_after.keys()
+            ctx['all_accounts'] = sorted(accounts_after.keys())
         self._send_rendered(EDIT_RAW if raw else EDIT_STRUCT, ctx)
 
     def get_ledger(self, ctx: dict[str, Any], raw: bool) -> None:
@@ -571,7 +571,7 @@ class Server(PlomHttpServer):
             for account_name in booking.account_changes:
                 booked_names.add(account_name)
         paths_to_accs: dict[str, Account] = {}
-        for full_name in booked_names:
+        for full_name in sorted(list(booked_names)):
             path = ''
             for step_name in full_name.split(':'):
                 parent_name = path[:]
-- 
2.30.2