From fd773817ebe3f108e4d5302ce0d704025f489ed0 Mon Sep 17 00:00:00 2001 From: Hugh Rundle Date: Fri, 28 Jun 2024 18:28:26 +1000 Subject: [PATCH] fix faulty description appending code --- blogs/management/commands/check_feeds.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/blogs/management/commands/check_feeds.py b/blogs/management/commands/check_feeds.py index fad09c8..a986823 100644 --- a/blogs/management/commands/check_feeds.py +++ b/blogs/management/commands/check_feeds.py @@ -142,15 +142,15 @@ class Command(BaseCommand): ) ) if description: - description[:200] += "..." + desc = description[:200] + "..." else: - description = "" + desc = "" instance = models.Article.objects.create( title=article.title, author_name=author_name, url=article.link, - description=description, + description=desc, updateddate=date_to_tz_aware( article.updated_parsed ), @@ -224,15 +224,15 @@ class Command(BaseCommand): ) ) if description: - description[:200] += "..." + desc = description[:200] + "..." else: - description = "" + desc = "" instance = models.Edition.objects.create( title=edition.title, author_name=author_name, url=edition.link, - description=description, + description=desc, updateddate=date_to_tz_aware(edition.updated_parsed), newsletter=newsletter, pubdate=date_to_tz_aware(edition.published_parsed),