diff options
author | luxagraf <sng@luxagraf.net> | 2023-11-17 16:03:19 -0500 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2023-11-17 16:03:19 -0500 |
commit | 6b1ae214361f533e53d8993a530e5d2b17c4f4e9 (patch) | |
tree | 6617a570f8ded12c300d9ea9025dc21962e1d613 /app/gtd/management/commands | |
parent | 6d588f8ff8a9938699a2af14c33d80eb33dca818 (diff) |
gtd: fixed some bugs in RSS updater
Diffstat (limited to 'app/gtd/management/commands')
-rw-r--r-- | app/gtd/management/commands/rss_updater.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/gtd/management/commands/rss_updater.py b/app/gtd/management/commands/rss_updater.py index 0f3796b..2e13fc9 100644 --- a/app/gtd/management/commands/rss_updater.py +++ b/app/gtd/management/commands/rss_updater.py @@ -1,4 +1,5 @@ from django.core.management.base import BaseCommand, CommandError +from django.core.exceptions import ObjectDoesNotExist import datetime import feedparser @@ -34,10 +35,13 @@ class Command(BaseCommand): post.date_last_pub = datetime.datetime.strptime(item.published, '%a, %d %b %Y %H:%M:%S %z').date() post.post_status = PostStatus.PUBLISHED post.save() + post = WiredPost.objects.get(url=item.link) + #print(post.date_last_pub) self.stdout.write( self.style.SUCCESS('Successfully updated post "%s"' % post.title) ) - except: + except ObjectDoesNotExist: + #print("skipping ", item.title) continue |