Skip to content

Commit

Permalink
Remove OrderedDict from auth_store (#108546)
Browse files Browse the repository at this point in the history
normal dicts keep track of insert order now so this should
no longer be needed
  • Loading branch information
bdraco authored Jan 21, 2024
1 parent a042073 commit 3c6e7b1
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions homeassistant/auth/auth_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from __future__ import annotations

import asyncio
from collections import OrderedDict
from datetime import timedelta
import hmac
from logging import getLogger
Expand Down Expand Up @@ -319,9 +318,9 @@ async def _async_load_task(self) -> None:
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
Expand Down Expand Up @@ -581,9 +580,9 @@ def _data_to_save(self) -> dict[str, list[dict[str, Any]]]:

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()
Expand Down

0 comments on commit 3c6e7b1

Please sign in to comment.