Skip to content

Commit

Permalink
Revert some unnecessary changes
Browse files Browse the repository at this point in the history
  • Loading branch information
awarecan committed Jul 21, 2018
1 parent ff626ed commit 77788d2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions homeassistant/auth/auth_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,10 @@ async def async_load(self):
self._users = users
return

for user_dict in data.get('users', []):
for user_dict in data['users']:
users[user_dict['id']] = models.User(**user_dict)

for cred_dict in data.get('credentials', []):
for cred_dict in data['credentials']:
users[cred_dict['user_id']].credentials.append(models.Credentials(
id=cred_dict['id'],
is_new=False,
Expand All @@ -155,7 +155,7 @@ async def async_load(self):

refresh_tokens = OrderedDict()

for rt_dict in data.get('refresh_tokens', []):
for rt_dict in data['refresh_tokens']:
token = models.RefreshToken(
id=rt_dict['id'],
user=users[rt_dict['user_id']],
Expand All @@ -168,7 +168,7 @@ async def async_load(self):
refresh_tokens[token.id] = token
users[rt_dict['user_id']].refresh_tokens[token.token] = token

for ac_dict in data.get('access_tokens', []):
for ac_dict in data['access_tokens']:
refresh_token = refresh_tokens[ac_dict['refresh_token_id']]
token = models.AccessToken(
refresh_token=refresh_token,
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/auth/providers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
vol.Optional(CONF_NAME): str,
# Specify ID if you have two auth providers for same type.
vol.Optional(CONF_ID): str,
})
}, extra=vol.ALLOW_EXTRA)


async def auth_provider_from_config(hass, store, config):
Expand Down
2 changes: 1 addition & 1 deletion tests/scripts/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

import pytest

from homeassistant.auth.providers import homeassistant as hass_auth
from homeassistant.scripts import auth as script_auth
from homeassistant.auth.providers import homeassistant as hass_auth
from tests.common import register_auth_provider


Expand Down

0 comments on commit 77788d2

Please sign in to comment.