title: Django Template Tag Conditional
body: <p>How make a a conditional statement out of a <strong>Django Template Tag</strong>?</p>
  
  <pre><code>from django import template
  from django.contrib.auth.models import User, Group
  
  register = template.Library()
  
  @register.simple_tag
  def is_designer(user_id):
      try:
          group = Group.objects.get(
              name = "Designer",
              user = user_id
          )
          return True
      except Group.DoesNotExist:
          return False
  </code></pre>
  
  <p>This appears True or False in my template which is correct:</p>
  
  <pre><code>{% is_designer user.id %}
  </code></pre>
  
  <p>However these gives me an error "<strong>Unused 'user.id' at end of if expression.</strong>":</p>
  
  <blockquote>
    <p>{% if is_designer user.id == True %} Yes {% endif %}</p>
    
    <p>{% if is_designer user.id %} Yes {% endif %}</p>
  </blockquote>