Commit eb9caa1c authored by Robert's avatar Robert

Fix rss import in case of empty id

parent 3ac9b2d2
Pipeline #1412 failed with stage
in 1 minute and 54 seconds
......@@ -45,7 +45,9 @@ class Command(
feed = feedparser.parse(feed_url)
for entry in feed.entries:
key = entry.get('id', entry.get('link'))
key = entry.get('id')
if not key:
key = entry.get('link')
if key and not models.Imported.objects.filter(key=key).exists():
title = entry.get('title')
text = html2text(entry.get('summary'), preset='import')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment