From 2745471412c031ae84eeb6205179e931fc6cb519 Mon Sep 17 00:00:00 2001 From: Johan Lundberg Date: Tue, 31 Mar 2026 15:37:52 +0200 Subject: [PATCH] fix: narrow type for PasswordChange to satisfy type checker Use isinstance check instead of bool flag to help ty resolve the current_password attribute on the validated model. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/porchlight/manage/routes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/porchlight/manage/routes.py b/src/porchlight/manage/routes.py index 7f15ca0..8399c8e 100644 --- a/src/porchlight/manage/routes.py +++ b/src/porchlight/manage/routes.py @@ -82,7 +82,7 @@ async def set_password( return HTMLResponse(format_validation_errors(exc)) # Verify current password if changing - if has_password: + if has_password and isinstance(validated, PasswordChange): if not password_service.verify(existing.password_hash, validated.current_password): return HTMLResponse('
Current password is incorrect
')