Narayan
Narayan

Reputation: 11

In HTML unable to execute django if statement

enter image description here

I have created models as shown in the picture. In the index page to display certain content, the member must be active. I am trying to use the if statement.

{% if user.active == True %} do this... {% endif %}

The above code is not working, also django is not throwing any error. Can anyone please help me on this?

Upvotes: 1

Views: 41

Answers (1)

DEEPAK KUMAR
DEEPAK KUMAR

Reputation: 362

Try simply {% if user.active %} do this... {% endif %} where user should be the instance of Type1user

Upvotes: 1

Related Questions