Remove redundant user check in Geocaching config flow (#193074)

This commit is contained in:
epenet
2026-11-19 16:57:34 +00:00
committed by GitHub
parent f1e799183f
commit 2a682c8a31
2 changed files with 3 additions and 3 deletions
@@ -48,7 +48,7 @@ class GeocachingFlowHandler(AbstractOAuth2FlowHandler, domain=DOMAIN):
session=async_get_clientsession(self.hass),
)
status = await api.update()
if not status.user or not status.user.username:
if not status.user.username:
return self.async_abort(reason="oauth_error")
if existing_entry := await self.async_set_unique_id(
@@ -161,8 +161,8 @@ async def test_oauth_error(
resp = await client.get(f"/auth/external/callback?code=abcd&state={state}")
assert resp.status == HTTPStatus.OK
# No user information is returned from API
mock_geocaching_config_flow.update.return_value.user = None
# No username is returned from API
mock_geocaching_config_flow.update.return_value.user.username = None
aioclient_mock.post(
CURRENT_ENVIRONMENT_URLS["token_url"],