Use assignment expressions 05 (#57785)

This commit is contained in:
Marc Mueller 2021-10-17 19:56:00 +02:00 committed by GitHub
parent d09ee11c54
commit 5048bad050
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 36 additions and 71 deletions

View file

@ -103,8 +103,7 @@ async def websocket_delete(hass, connection, msg):
@websocket_api.async_response
async def websocket_change_password(hass, connection, msg):
"""Change current user password."""
user = connection.user
if user is None:
if (user := connection.user) is None:
connection.send_error(msg["id"], "user_not_found", "User not found")
return