mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 09:47:13 +00:00
Switch imap to use async_update_reload_and_abort helper (#108935)
This commit is contained in:
parent
b1b53ac893
commit
5177d022e8
@ -169,11 +169,9 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
||||
if user_input is not None:
|
||||
user_input = {**self._reauth_entry.data, **user_input}
|
||||
if not (errors := await validate_input(self.hass, user_input)):
|
||||
self.hass.config_entries.async_update_entry(
|
||||
return self.async_update_reload_and_abort(
|
||||
self._reauth_entry, data=user_input
|
||||
)
|
||||
await self.hass.config_entries.async_reload(self._reauth_entry.entry_id)
|
||||
return self.async_abort(reason="reauth_successful")
|
||||
|
||||
return self.async_show_form(
|
||||
description_placeholders={
|
||||
|
@ -239,6 +239,7 @@ async def test_reauth_success(hass: HomeAssistant, mock_setup_entry: AsyncMock)
|
||||
CONF_PASSWORD: "test-password",
|
||||
},
|
||||
)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert result2["type"] == FlowResultType.ABORT
|
||||
assert result2["reason"] == "reauth_successful"
|
||||
|
Loading…
x
Reference in New Issue
Block a user