wbg opened a new pull request, #76473:
URL: https://github.com/apache/airflow/pull/76473
`MultiResourceUserMixin.show()` pops `userinfoedit` and `resetmypassword`
from `widgets["show"].template_args["actions"]`. FAB's `_get_show_widget`
passes the view's own `self.actions` dict through (`actions = actions or
self.actions`), so the pop removes both actions from the view instance for the
rest of the process lifetime.
Once an admin opens a user's show page (`/auth/users/show/<pk>`),
`/auth/users/userinfo/` fails for everyone on that worker:
```
File ".../flask_appbuilder/filters.py", line 39, in get_actions_on_show
if self.is_item_visible(action.name, modelview_name) and action.single:
AttributeError: 'NoneType' object has no attribute 'name'
```
and "Reset my password" (`POST /auth/users/action/resetmypassword/<pk>`)
fails with `'NoneType' object has no attribute 'func'`. Only an api-server
restart helps until the next admin opens a show page. With several workers it
looks random.
Repro:
1. log in as admin, Security → Users → open any user (show)
2. open `/auth/users/userinfo/` → 500
Hit this on prod with Airflow 3.3.0, providers-fab 3.7.1, FAB 5.2.1; the
code is the same on main. The pop came in with #38957. It's in the mixin, so
all user views (DB, LDAP, OAuth, remote user) are affected.
Fix: build a filtered copy instead of mutating the shared dict. The show
page still hides both actions (#38922 stays fixed), userinfo keeps them. Added
a regression test to `test_user.py`.
Tested:
- new test fails on main (`500 == 200`, same `AttributeError`) and passes
with the fix
- `providers/fab/tests/unit/fab/auth_manager/views/` pass locally
- `prek run --from-ref main` passes, mypy on `views/user.py` is clean
(didn't run the breeze-based `mypy-providers` hook)
- verified against a 3.3.0 / FAB 5.2.1 install: userinfo → show → userinfo
was 200/200/500, now 200/200/200
related: #38922
---
##### Was generative AI tooling used to co-author this PR?
- [X] Yes (please specify the tool below)
Generated-by: Claude Code (Claude Opus 5.5) following [the
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
Debugging, the reproduction and the patch were done with Claude Code; I
reviewed the change and verified it on our install.
---
* Read the **[Pull Request
Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)**
for more information. Note: commit author/co-author name and email in commits
become permanently public when merged.
* For fundamental code changes, an Airflow Improvement Proposal
([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals))
is needed.
* When adding dependency, check compliance with the [ASF 3rd Party License
Policy](https://www.apache.org/legal/resolved.html#category-x).
* For significant user-facing changes create newsfragment:
`{pr_number}.significant.rst`, in
[airflow-core/newsfragments](https://github.com/apache/airflow/tree/main/airflow-core/newsfragments).
You can add this file in a follow-up commit after the PR is created so you
know the PR number.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01R3xD6LuvM6iFQwAW2GQ2iS
--
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]