Django

Code

Ticket #2702 (closed: fixed)

Opened 2 years ago

Last modified 2 years ago

[patch] Subtle bug in LazyUser

Reported by: jkocherhans Assigned to: adrian
Milestone: Component: Contrib apps
Version: Keywords:
Cc: Maniac@SoftwareManiacs.Org, mir@noris.de Triage Stage: Unreviewed
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

lazyuser.diff (0.7 kB) - added by jkocherhans on 09/11/06 18:56:29.

Change History

09/11/06 16:28:32 changed by jkocherhans

  • component changed from Admin interface to Contrib apps.

09/11/06 18:34:53 changed by Ivan Sagalaev <Maniac@SoftwareManiacs.Org>

  • cc set to Maniac@SoftwareManiacs.Org.

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

09/11/06 18:56:29 changed by jkocherhans

  • attachment lazyuser.diff added.

09/11/06 18:58:09 changed by jkocherhans

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

09/12/06 03:41:47 changed by mir@noris.de

  • cc changed from Maniac@SoftwareManiacs.Org to Maniac@SoftwareManiacs.Org, mir@noris.de.

09/12/06 12:30:47 changed by adrian

  • status changed from new to closed.
  • resolution set to fixed.

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


Add/Change #2702 ([patch] Subtle bug in LazyUser)




Change Properties
Action