Aaryan123456679 opened a new pull request, #70243: URL: https://github.com/apache/airflow/pull/70243
The Show User view already surfaces a Reset Password action button (via FAB's show-widget actions block), but the Edit User view has no equivalent, forcing admins to navigate back to Show User just to reset a password. This wires the same, already-registered `resetpasswords` action into the Edit User page: - `CustomUserDBModelView` gets a dedicated `edit_widget` (`UserEditFormWidget`) and overrides `edit()` to inject the `resetpasswords` action, `pk`, and `modelview_name` into the widget's template context, mirroring the existing `show()` override pattern in the same file. - A new template, `appbuilder/general/widgets/user_edit_form.html`, extends FAB's built-in `form_vertical.html` with the same `render_action_links` block already used by `show.html`. No new routes or permissions were introduced — the fix reuses the existing `resetpasswords` action, route, and permission mapping. closes: #37030 ##### Test plan - [x] Added `test_user_edit_view_shows_reset_password_action_with_access` — asserts the Reset Password link renders on the Edit User page for a user with read/edit access to Users and read access to Passwords. - [x] Added `test_user_edit_view_hides_reset_password_action_without_access` — asserts the link is absent when the user lacks read access to Users. - [x] Ran the full existing test file (`test_views_custom_user_views.py`, 28 tests) plus the broader `providers/fab/tests/unit/fab/www/views/` and `providers/fab/tests/unit/fab/auth_manager/views/` suites (46 tests total) — all passed, no regressions. - [x] `prek run --from-ref upstream/main --stage pre-commit` and `--stage manual` — passed. - [x] `breeze run mypy providers/fab/src/airflow/providers/fab/auth_manager/views/user.py` — passed. --- ##### Was generative AI tooling used to co-author this PR? - [X] Yes — Claude Code (Sonnet 5) Generated-by: Claude Code (Sonnet 5) following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
