bug fixes

- fix can't append str to None
- fix ManyRelatedManager error in blog post announcements
- fix timedelta doesn't have "month"
This commit is contained in:
Hugh Rundle 2024-02-05 15:31:24 +11:00
parent 3c0544e5a1
commit 2d84788520
Signed by: hugh
GPG key ID: A7E35779918253F9
3 changed files with 4 additions and 3 deletions

View file

@ -209,7 +209,8 @@ class Command(BaseCommand):
)
else None
)
description += "..."
if description:
description += "..."
instance = models.Edition.objects.create(
title=edition.title,

View file

@ -33,7 +33,7 @@ class Command(BaseCommand):
if (
conf.announcements < 1
or (delta < timedelta(days=7))
or (delta < timedelta(months=3) and conf.announcements < 2)
or (delta < timedelta(days=90) and conf.announcements < 2)
):
conf.announce()

View file

@ -122,7 +122,7 @@ class Article(BlogData):
label = warning.is_in(text)
if label:
summmary.append(label)
for tag in self.tags: # pylint: disable=E1133
for tag in self.tags.all(): # pylint: disable=E1133
label = warning.is_in(tag.name)
if label:
summmary.append(label)