diff options
Diffstat (limited to 'app/gtd/management/commands/rss_updater.py')
-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 |