I'm trying to avoid an extra DB hit by first checking for records in controller. I set a "yes" or "no" type flag
But the conditional in the view doesn't care if flag is set to no, it still raises error stating that the set within the conditional is undefined.
Is the only way to get around this is put the isempty check in the view instead of controller?
{{if does_user_have_admin_roles == True:}} <!-- this is view. The controller defines does_user_have_admin_roles -->
{{for r in admin_roles:}}
<type 'exceptions.NameError'> name 'admin_roles' is not defined
also tried: {{if admin_roles:}}
thanks,
Alex Glaros