From 3c6e7b188e5c81ed5a78c108afecccd4662b763e Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sat, 20 Jan 2024 15:36:43 -1000 Subject: [PATCH] Remove OrderedDict from auth_store (#108546) normal dicts keep track of insert order now so this should no longer be needed --- homeassistant/auth/auth_store.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/homeassistant/auth/auth_store.py b/homeassistant/auth/auth_store.py index c8f5001a515..534016a54e0 100644 --- a/homeassistant/auth/auth_store.py +++ b/homeassistant/auth/auth_store.py @@ -2,7 +2,6 @@ from __future__ import annotations import asyncio -from collections import OrderedDict from datetime import timedelta import hmac from logging import getLogger @@ -319,9 +318,9 @@ class AuthStore: self._set_defaults() return - users: dict[str, models.User] = OrderedDict() - groups: dict[str, models.Group] = OrderedDict() - credentials: dict[str, models.Credentials] = OrderedDict() + users: dict[str, models.User] = {} + groups: dict[str, models.Group] = {} + credentials: dict[str, models.Credentials] = {} # Soft-migrating data as we load. We are going to make sure we have a # read only group and an admin group. There are two states that we can @@ -581,9 +580,9 @@ class AuthStore: def _set_defaults(self) -> None: """Set default values for auth store.""" - self._users = OrderedDict() + self._users = {} - groups: dict[str, models.Group] = OrderedDict() + groups: dict[str, models.Group] = {} admin_group = _system_admin_group() groups[admin_group.id] = admin_group user_group = _system_user_group()