simplelazyobject breaks code

35 views
Skip to first unread message

ozgurisil

unread,
Oct 19, 2009, 10:36:22 AM10/19/09
to Django users

Here's a template filter that has been working without problems till
recently, before I updated Django source:

from pm_core.models import PMUser

@register.filter
def can_manage_market(user, market):
if not isinstance(user, PMUser): return False
return user.can_manage_market(market)

The filter has begun to return false always. The problem seems to be
that the 'user' instance is of 'SimpleLazyObject' instead of PMUser (a
subclass of User). Searching it up on the internet brought me to
Ticket #12049, which indicates that this may be a similar bug
(however, the patch provided there is not a remedy, unfortunately).
Should I file a ticket, or is there anything I am missing?

Thanks in advance,
Ozgur.

Eric Holscher

unread,
Oct 20, 2009, 12:17:51 AM10/20/09
to Django users
Went ahead and filed a ticket for this. If you would chime in with
your example it probably wouldn't hurt, but I will link to this thread
as well.

http://code.djangoproject.com/ticket/12060

Cheers,
Eric
Reply all
Reply to author
Forward
0 new messages