home · contact · privacy
Restore alphabetical sorting of account names. master
authorChristian Heller <c.heller@plomlompom.de>
Sun, 9 Feb 2025 08:23:19 +0000 (09:23 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Sun, 9 Feb 2025 08:23:19 +0000 (09:23 +0100)
src/run.py

index b3e2c5c4436835576e8b1e02e70e735b94a172ec..abd17094dbff903bec6b16acfca67b8b79d36fb8 100755 (executable)
@@ -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['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:
         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 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[:]
             path = ''
             for step_name in full_name.split(':'):
                 parent_name = path[:]