#12060: Auth Context Processor returns user as a Lazy Object, which breaks 
things
-------------------------------------+--------------------------------------
          Reporter:  ericholscher    |         Owner:  nobody
            Status:  new             |     Milestone:        
         Component:  Authentication  |       Version:  1.1   
        Resolution:                  |      Keywords:        
             Stage:  Unreviewed      |     Has_patch:  0     
        Needs_docs:  0               |   Needs_tests:  0     
Needs_better_patch:  0               |  
-------------------------------------+--------------------------------------
Comment (by nathan):

 I have a very simple use case:

 Filter:

 {{{
 @register.filter
 def is_equal(obj, arg):
     "Returns a boolean of whether the value is equal to the argument"
     return obj == arg
 }}}

 Template (assuming a user is logged in):

 {{{
 {% if user|is_equal:book.user %} do something {% endif %}
 }}}

 This currently returns False if the user is in fact the same as the book
 user since it's being evaluated against 'SimpleLazyObject' instead of the
 actual user object.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/12060#comment:2>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to