Opened 18 years ago

Closed 18 years ago

#2702 closed defect (fixed)

[patch] Subtle bug in LazyUser

Reported by: jkocherhans Owned by: Adrian Holovaty
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: no UI/UX: no


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 18 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 by jkocherhans, 18 years ago

Component: Admin interfaceContrib apps

comment:2 by Ivan Sagalaev <Maniac@…>, 18 years ago

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" ?

by jkocherhans, 18 years ago

Attachment: lazyuser.diff added

comment:3 by jkocherhans, 18 years ago

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

comment:4 by mir@…, 18 years ago

Cc: mir@… added

comment:5 by Adrian Holovaty, 18 years ago

Resolution: fixed
Status: newclosed

(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