Opened 19 years ago
Closed 19 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 by , 19 years ago
| Component: | Admin interface → Contrib apps |
|---|
comment:2 by , 19 years ago
| Cc: | added |
|---|
by , 19 years ago
| Attachment: | lazyuser.diff added |
|---|
comment:3 by , 19 years ago
Doh! Um.. yes, it would. I knew something looked really weird about that line. Patch updated.
comment:4 by , 19 years ago
| Cc: | added |
|---|
comment:5 by , 19 years ago
| 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" ?