'Error rendering a Simple.tag on template - Django

I've create a simple.tag on extratags.py which checks if the user is an attendant of the post event.

extra_tags.py

@register.simple_tag
def get_attendent_user(post_id, user_id):
    return Attending.objects.filter(post__id=post_id, attendant__id=user_id).exists()

If I render this {% get_attendent_user post.id user.id %} on the template is working but, the idea is to play with an IF condition there.

So if I render this on the template:

{% if get_attendent_user post.id user.id is False %}
<p>ok</p>
{% else %}
<p>Not requested</p>
{% endif %}

is giving me the error: Unused 'post.id' at end of if expression.

How can I correctly render this on the template?

Thanks!!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source