GitHub user dosubot[bot] added a comment to the discussion: An error occurs when accessing /users/userinfo/ after deleting a user:AttributeError: 'AnonymousUserMixin' object has no attribute 'id'
<!-- Answer --> This error happens because Flask-AppBuilder's userinfo view doesn't check if the user is anonymous before accessing g.user.id. When you delete a user but the session remains, g.user becomes an AnonymousUserMixin, which lacks an id attribute, causing the AttributeError. To fix this: log out and log back in, or clear your browser's session cookies to remove any lingering references to the deleted user. If you have custom session or authentication logic, make sure it handles deleted users gracefully. For a more robust fix, consider overriding the FAB userinfo view to check for anonymous users before accessing user attributes, or update FAB if a patch becomes available. More details and workarounds are discussed [here](https://github.com/apache/superset/discussions/32808). <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/8ce12568-8684-46b1-9618-6910776b7a21?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/8ce12568-8684-46b1-9618-6910776b7a21?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/8ce12568-8684-46b1-9618-6910776b7a21?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/8ce12568-8684-46b1-9618-6910776b7a21?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/8ce12568-8684-46b1-9618-6910776b7a21?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/8ce12568-8684-46b1-9618-6910776b7a21?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/8ce12568-8684-46b1-9618-6910776b7a21?feedback_type=other)</sup> [](https://go.dosu.dev/discord-bot) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/discussions/33825) GitHub link: https://github.com/apache/superset/discussions/33825#discussioncomment-13518607 ---- This is an automatically sent email for [email protected]. To unsubscribe, please send an email to: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
