You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying out the latest master on Django 3.1. I understand that this doesn't appear to be officially supported yet, but I noticed support had been enabled in the latest HEAD, so I thought I'd give it a go.
I ran into a strange issue with the ifinstalled template tag - it doesn't seem to work at all and tries to include the contents regardless of whether the app is installed.
After some investigation, I narrowed this down to the following in the definition of the isinstalled tag (in core/templatetags/mezzanine_tags.py):
while unmatched_end_tag:
token = parser.tokens.pop(0)
It appears this is processing the nodes in the wrong order (last token first). It looks like parser.tokens returns the nodes in reverse order. I can only presume this is a new change in Django 3, but I haven't done any deep investigation into this.
A simple and obvious fix for this appears to be:
while unmatched_end_tag:
token = parser.tokens.pop()
However, I imagine this would break Django < 3, so you would probably need to add some conditions around this.
Anyway, hopefully this provides enough groundwork for someone more familiar with the project/codebase to take it from here.
The text was updated successfully, but these errors were encountered:
dbischof
added a commit
to CompostNow/mezzanine
that referenced
this issue
Feb 1, 2021
I'm trying out the latest master on Django 3.1. I understand that this doesn't appear to be officially supported yet, but I noticed support had been enabled in the latest HEAD, so I thought I'd give it a go.
I ran into a strange issue with the
ifinstalled
template tag - it doesn't seem to work at all and tries to include the contents regardless of whether the app is installed.After some investigation, I narrowed this down to the following in the definition of the
isinstalled
tag (in core/templatetags/mezzanine_tags.py):It appears this is processing the nodes in the wrong order (last token first). It looks like
parser.tokens
returns the nodes in reverse order. I can only presume this is a new change in Django 3, but I haven't done any deep investigation into this.A simple and obvious fix for this appears to be:
However, I imagine this would break Django < 3, so you would probably need to add some conditions around this.
Anyway, hopefully this provides enough groundwork for someone more familiar with the project/codebase to take it from here.
The text was updated successfully, but these errors were encountered: