ozgurisil
unread,Oct 19, 2009, 10:36:22 AM10/19/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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.