vincbeck commented on code in PR #76473:
URL: https://github.com/apache/airflow/pull/76473#discussion_r4592016561
##########
providers/fab/src/airflow/providers/fab/auth_manager/views/user.py:
##########
@@ -78,8 +78,14 @@ def class_permission_name(self, name):
def show(self, pk):
pk = self._deserialize_pk_if_composite(pk)
widgets = self._show(pk)
- widgets["show"].template_args["actions"].pop("userinfoedit", None)
- widgets["show"].template_args["actions"].pop("resetmypassword", None)
+ # The widget gets the view's shared ``self.actions`` dict, so build a
filtered copy
+ # instead of popping from it, which would break ``/users/userinfo/``
for everyone.
Review Comment:
nit: the comment describes the previous code, maybe just say why:
```suggestion
# ``template_args["actions"]`` is the view's shared ``self.actions``
dict, never mutate it.
# userinfo and the action endpoints read from it too.
```
--
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]