Opened 13 years ago
Closed 13 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 |
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)
Change History (6)
comment:1 Changed 13 years ago by
| Component: | Admin interface → Contrib apps |
|---|
comment:2 Changed 13 years ago by
| Cc: | Maniac@… added |
|---|
Changed 13 years ago by
| Attachment: | lazyuser.diff added |
|---|
comment:3 Changed 13 years ago by
Doh! Um.. yes, it would. I knew something looked really weird about that line. Patch updated.
comment:4 Changed 13 years ago by
| Cc: | mir@… added |
|---|
comment:5 Changed 13 years ago by
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
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" ?