Ok, got my problem. May be your problem as well, mamcxyz.
I was using the user variable in a menu. In order to make my webpage
as generic as possible, I had defined a menu.html that I included with
a tag:
register = Library()
def make_menu(context):
pass
make_menu = register.inclusion_tag('sysvortex/menu.html')(make_menu)
I included my menu with a:
{% block extras %}
{% make_extras %}
{% endblock %}
I discovered that user was not available in menu.html. I then modified
my code like this:
register = Library()
def make_menu(context):
return context
make_menu = register.inclusion_tag('sysvortex/menu.html',
takes_context=True)(make_menu)
The only thing I do here is to pass the context I receive to the
context of menu.html. And of course... it works... :-P
Hope this helps others!
Guille
On 7/12/06, Joshua Tacoma <[EMAIL PROTECTED]> wrote:
>
> I don't know how to replicate it right now (I tried logging out and
> deleting cookies, no dice) but it did happen to me once or twice while
> I was developing something. If you only find this problem when you
> aren't logged in then treating 'not user' as equivalent to
> 'user.is_anonymous' should be ok.
>
> {% if user and not user.is_anonymous %}
> <p>Welcome, {{ user.username }}. Thanks for logging in.</p>
> {% else %}
> <p>Welcome, new user. Please log in.</p>
> {% endif %}
>
> This is only a work-around: if you can replicate it then I'd say it's
> ticket-worthy.
>
> -- Joshua
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" 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-users
-~----------~----~----~----~------~----~------~--~---