check newsletter description properly
also sends a blank string instead of None if nothing else matches fixes #11
This commit is contained in:
parent
ead268a47c
commit
496edb75b0
|
@ -135,7 +135,7 @@ class Command(BaseCommand):
|
||||||
hasattr(article, "content")
|
hasattr(article, "content")
|
||||||
and len(article.content)
|
and len(article.content)
|
||||||
)
|
)
|
||||||
else None
|
else ""
|
||||||
)
|
)
|
||||||
if description:
|
if description:
|
||||||
description += "..."
|
description += "..."
|
||||||
|
@ -202,14 +202,14 @@ class Command(BaseCommand):
|
||||||
else html.strip_tags(edition.description)
|
else html.strip_tags(edition.description)
|
||||||
if (
|
if (
|
||||||
hasattr(edition, "description")
|
hasattr(edition, "description")
|
||||||
and len(edition.summary)
|
and len(edition.description)
|
||||||
)
|
)
|
||||||
else html.strip_tags(edition.content[0].value)[:200] + "..."
|
else html.strip_tags(edition.content[0].value)[:200] + "..."
|
||||||
if (
|
if (
|
||||||
hasattr(article, "content")
|
hasattr(article, "content")
|
||||||
and len(article.content)
|
and len(article.content)
|
||||||
)
|
)
|
||||||
else None
|
else ""
|
||||||
)
|
)
|
||||||
if description:
|
if description:
|
||||||
description += "..."
|
description += "..."
|
||||||
|
|
Loading…
Reference in a new issue