Opened 9 years ago

Closed 9 years ago

#2702 closed defect (fixed)

[patch] Subtle bug in LazyUser

Reported by: jkocherhans Owned by: adrian
Component: Contrib apps Version:
Severity: normal Keywords:
Cc: Maniac@…, mir@… Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

The cached user is currently stored as an attribute of LazyUser, but should be stored as an attribute of the request. The current code behaves as if request.user were a class attribute.

Attachments (1)

lazyuser.diff (742 bytes) - added by jkocherhans 9 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 9 years ago by jkocherhans

  • Component changed from Admin interface to Contrib apps

comment:2 Changed 9 years ago by Ivan Sagalaev <Maniac@…>

  • Cc Maniac@… added

Joseph, one question on a self-educational note: wouldn't it be better to check for "hasattr(request, '_cached_user')" instead of "getattr(request, '_cached_user', None) is None" ?

Changed 9 years ago by jkocherhans

comment:3 Changed 9 years ago by jkocherhans

Doh! Um.. yes, it would. I knew something looked really weird about that line. Patch updated.

comment:4 Changed 9 years ago by mir@…

  • Cc mir@… added

comment:5 Changed 9 years ago by adrian

  • Resolution set to fixed
  • Status changed from new to closed

(In [3754]) Fixed #2702 -- Fixed LazyUser to store cache as attribute of request, not class. Thanks for the patch, jkocherhans

Note: See TracTickets for help on using tickets.
Back to Top