Skip to content

Commit

Permalink
rss.from_as1: remove possible addition of invalid author element
Browse files Browse the repository at this point in the history
  • Loading branch information
isnbh0 committed Dec 18, 2024
1 parent 14c9653 commit a841d77
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions granary/rss.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,11 @@ def from_as1(activities, actor=None, title=None, feed_url=None,
item.category(categories)

author = as1.get_object(obj, 'author')
author = {
'name': (author.get('displayName') or author.get('username')
or author.get('url') or author.get('id')),
'uri': author.get('url') or author.get('id'),
'email': author.get('email') or '-',
}
item.author(author)
if 'email' in author:
# author is optional in RSS 2.0 item spec,
# but if present, must be the email address of the author
# ref: https://www.rssboard.org/rss-specification#ltauthorgtSubelementOfLtitemgt
item.author(author={'email': author.get('email')})

published = obj.get('published') or obj.get('updated')
if published and isinstance(published, str):
Expand Down

0 comments on commit a841d77

Please sign in to comment.