views:

50

answers:

1

I have a flag attached to my "UserProfile" record for logged in users that lets me know whether the user is enabled for "new features" on my site. I want to be able to check this django template variable in all of my templates to hide/show new features

I already used:
{% if user.is_authenticated %}

To check for logged in users, I just want to add one more flag to that check. I don't want to modify the user model, is there a way to lookup the UserProfile for the user from the template?

+1  A: 
{% if user.get_profile.has_feature_enabled %}
Vasil