Skip to content

Commit

Permalink
🐛 Fix cases when updated_parsed exists but it None.
Browse files Browse the repository at this point in the history
  • Loading branch information
tibonihoo committed Aug 24, 2024
1 parent b63d426 commit 323a76e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions wom_river/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ def get_date_from_feedparser_feed(feed):
updated_date_utc = feed.updated_parsed[:6]
elif "published_parsed" in feed:
updated_date_utc = feed.published_parsed[:6]
elif "feed" in feed and "updated_parsed" in feed.feed:
elif "feed" in feed and feed.feed.get("updated_parsed", None) is not None:
updated_date_utc = feed.feed.updated_parsed[:6]
elif "feed" in feed and "published_parsed" in feed.feed:
elif "feed" in feed and feed.feed.get("published_parsed", None) is not None:
updated_date_utc = feed.feed.published_parsed[:6]
else:
logger.debug("No date found for feed %s" % feed)
Expand Down

0 comments on commit 323a76e

Please sign in to comment.