Custom template tag marked as error
Hello!
I have a custom template tag to check permissions. The use is like this:
{% haspermission PERMISSIONS.PENDING_FORMS %}
<div>Some restricted content</div>
{% end_haspermission %}
The implementation was taken from the django docs and goes like this:
@register.tag('haspermission')
def do_haspermission(parser, token):
nodelist = parser.parse(('end_haspermission',))
...
So, the template tag works perfect for django however Pycharm does not detect the closing "end_haspermission" tag and marks it as an error, I know this is not preventing me for work but the error mark on the html can bring some confusion to people.
How can I solve this?
Thanks and thank you for this awesome software!!!
EDIT: I just changed the closing tag 'end_haspermission' to 'endhaspermission' and now pycharm is happy again!
I have a custom template tag to check permissions. The use is like this:
{% haspermission PERMISSIONS.PENDING_FORMS %}
<div>Some restricted content</div>
{% end_haspermission %}
The implementation was taken from the django docs and goes like this:
@register.tag('haspermission')
def do_haspermission(parser, token):
nodelist = parser.parse(('end_haspermission',))
...
So, the template tag works perfect for django however Pycharm does not detect the closing "end_haspermission" tag and marks it as an error, I know this is not preventing me for work but the error mark on the html can bring some confusion to people.
How can I solve this?
Thanks and thank you for this awesome software!!!
EDIT: I just changed the closing tag 'end_haspermission' to 'endhaspermission' and now pycharm is happy again!
Please sign in to leave a comment.