openedx/openedx-platform

'WSGIRequest' object has no attribute 'user' error in enterprise code

开放

#37,995 创建于 2026年2月10日

 (2 条评论) (0 个反应) (0 位负责人)Python (4,331 个派生)auto 404
help wanted

仓库指标

星标
 (8,150 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

This line of enterprise code, is resulting in the error: builtins.AttributeError: 'WSGIRequest' object has no attribute 'user'.

I believe this just needs some simple exception handling to provide the same treatment as is done for an anonymous (not logged in) user, without raising an exception.

  • This should be a relatively quick fix.
  • This may not lead to end user problems, because it may just be happening during 404 processing, but I'm uncertain. It definitely muddies the 404 error details and observability.

贡献者指南