From f267db9148e3a390a1a2e50fe71ac4675dceaea1 Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Wed, 18 Nov 2026 21:28:28 +0100 Subject: refactor(core): tighten static typing Add explicit runtime narrowing in tests and simplify Huey decorator annotations so static analysis reflects the dynamic task wrapper behavior. Clean up URL argument construction and form error updates while preserving existing application behavior. --- webmentions_ssg/views/user.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'webmentions_ssg/views/user.py') diff --git a/webmentions_ssg/views/user.py b/webmentions_ssg/views/user.py index 4675ade..ec253c4 100644 --- a/webmentions_ssg/views/user.py +++ b/webmentions_ssg/views/user.py @@ -25,7 +25,10 @@ def user_page() -> ResponseReturnValue: if form.validate_on_submit(): user = cast(User, current_user._get_current_object()) if not user.check_password(form.current_password.data or ""): - form.current_password.errors.append("Current password is incorrect.") + form.current_password.errors = [ + *form.current_password.errors, + "Current password is incorrect.", + ] else: user.password = form.new_password.data or "" db.session.commit() -- cgit v1.3.1