From 562e1431b960f6003243e8708957048b8fc8f922 Mon Sep 17 00:00:00 2001 From: miruka Date: Fri, 22 May 2020 08:48:58 -0400 Subject: [PATCH] Fix adding account when none were previously saved --- src/backend/user_files.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend/user_files.py b/src/backend/user_files.py index 40fe18d7..81954aa3 100644 --- a/src/backend/user_files.py +++ b/src/backend/user_files.py @@ -192,10 +192,10 @@ class Accounts(JSONDataFile): "token": client.access_token, "device_id": client.device_id, "enabled": True, - "order": max( + "order": max([ account.get("order", i) for i, account in enumerate(saved.values()) - ) + 1, + ] or [-1]) + 1, }, })