fix: Access item title and unique_id as dict keys
This commit is contained in:
parent
870ab7b6fc
commit
59cd6d8358
|
@ -13,14 +13,15 @@ def modify_feed(context, feed):
|
||||||
articles[article.title] = article
|
articles[article.title] = article
|
||||||
|
|
||||||
for item in feed.items:
|
for item in feed.items:
|
||||||
article = articles.get(item.title)
|
item_title = item['title']
|
||||||
|
article = articles.get(item_title)
|
||||||
if not article:
|
if not article:
|
||||||
raise Exception(f"Article not found for title: {item.title}")
|
raise Exception(f"Article not found for title: {item_title}")
|
||||||
|
|
||||||
if not hasattr(article, 'guid') or not article.guid:
|
if not hasattr(article, 'guid') or not article.guid:
|
||||||
raise Exception(f"Article '{article.title}' is missing a guid.")
|
raise Exception(f"Article '{article.title}' is missing a guid.")
|
||||||
|
|
||||||
item.unique_id = article.guid
|
item['unique_id'] = article.guid
|
||||||
|
|
||||||
|
|
||||||
def register():
|
def register():
|
||||||
|
|
Loading…
Reference in New Issue
Block a user