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
This is similar to #18, although the specifics I'm seeing are slightly different than what was described there.
I've got a draft article with my first series in it.. and just added series support to my theme. My pelicanconf.py defines DEFAULT_METADATA of "status": "published" for development purposes, and publishconf.py sets that default to draft. This is the setup I use so that the devserver will show me draft articles as they will appear once published. My uses of pelican-series worked fine in this setup until I tried to do a producton publish of a new article, while the unfinished series article is still in drafts.
When Pelican's make publish target hits that draft article, it fails. The first encountered error is a reference to article.series.previous.url:
UndefinedError: 'str object' has no attribute 'previous'
The error comes from this bit of template in my article.html:
That block is itself wrapped in an if to check whether the article is part of a series:
{%ifSHOW_SERIESandarticle.seriesisdefined%}
The draft in question is the first and only article in the series, so article.series.next and article.series.previous should both be None. I've done some strategic commenting-out of bits of the template and inserting values as comments to determine that article.series.previous actually references article.series.name in a draft, rather than article.series.all_previous[-1], as it does when the article is published.
Oddly, article.series.index and article.series.name both seem to be empty string when the document is a draft, but work as expected when the document is published.
Relevant software version info from my virtualenv:
@mpounsett I'm so sorry I ignored this error for so long. Would you be able to provide a GH repo with a minimal example of the situation? This way it will be very easy to debug. Thanks, and again so sorry for the delay.
This is similar to #18, although the specifics I'm seeing are slightly different than what was described there.
I've got a draft article with my first series in it.. and just added series support to my theme. My
pelicanconf.py
defines DEFAULT_METADATA of"status": "published"
for development purposes, andpublishconf.py
sets that default todraft
. This is the setup I use so that the devserver will show me draft articles as they will appear once published. My uses ofpelican-series
worked fine in this setup until I tried to do a producton publish of a new article, while the unfinished series article is still in drafts.When Pelican's
make publish
target hits that draft article, it fails. The first encountered error is a reference toarticle.series.previous.url
:The error comes from this bit of template in my
article.html
:That block is itself wrapped in an if to check whether the article is part of a series:
The draft in question is the first and only article in the series, so
article.series.next
andarticle.series.previous
should both beNone
. I've done some strategic commenting-out of bits of the template and inserting values as comments to determine thatarticle.series.previous
actually referencesarticle.series.name
in a draft, rather thanarticle.series.all_previous[-1]
, as it does when the article is published.Oddly,
article.series.index
andarticle.series.name
both seem to be empty string when the document is a draft, but work as expected when the document is published.Relevant software version info from my virtualenv:
The text was updated successfully, but these errors were encountered: