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).
I'd appreciate any information on this simplelazyobject that I have not been aware of before.
ps. I have also posted this question to django-users group, but have not received an answer yet.