openedx/openedx-platform

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

Aberta

#37.995 aberto em 10 de fev. de 2026

 (2 comentários) (0 reação) (0 responsável)Python (4.331 forks)auto 404
help wanted

Métricas do repositório

Stars
 (8.150 estrelas)
Métricas de merge de PR
 (Métricas PR pendentes)

Description

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.

Guia do colaborador