Skip to content

Commit

Permalink
update for review
Browse files Browse the repository at this point in the history
  • Loading branch information
rbi-aap committed Jul 17, 2024
1 parent c3be21b commit b826fb4
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions newsroom/news_api/news/syndicate/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,14 @@ def generate_atom_feed(response, token=None):
SubElement(feed, 'title').text = etree.CDATA('{} Atom Feed'.format(app.config['SITE_NAME']))
SubElement(feed, 'updated').text = __class__._format_update_date(utcnow())
SubElement(SubElement(feed, 'author'), 'name').text = app.config['SITE_NAME']
SubElement(feed, 'id').text = url_for('syndicate.get_syndicate_feed', syndicate_type='syndicate', _external=True, formatter='atom')
feed_url = url_for('syndicate.get_syndicate_feed',
syndicate_type='syndicate',
_external=True,
formatter='atom')

SubElement(feed, 'id').text = feed_url
SubElement(feed, 'link',
attrib={'href': url_for('syndicate.get_syndicate_feed', syndicate_type='syndicate', _external=True, formatter='atom'),
'rel': 'self'})
attrib={'href': feed_url, 'rel': 'self'})
item_resource = get_resource_service('items')
image = None
for item in response['_items']:
Expand Down Expand Up @@ -206,7 +210,11 @@ def generate_rss_feed(response, token=None):
channel = SubElement(feed, 'channel')
SubElement(channel, 'title').text = '{} RSS Feed'.format(app.config['SITE_NAME'])
SubElement(channel, 'description').text = '{} RSS Feed'.format(app.config['SITE_NAME'])
SubElement(channel, 'link').text = url_for('syndicate.get_syndicate_feed', syndicate_type='syndicate', _external=True, formatter='rss')
feed_url = url_for('syndicate.get_syndicate_feed',
syndicate_type='syndicate',
_external=True,
formatter='rss')
SubElement(channel, 'link').text = feed_url
item_resource = get_resource_service('items')
image = None
for item in response['_items']:
Expand Down Expand Up @@ -254,7 +262,7 @@ def generate_rss_feed(response, token=None):
'COPYRIGHT_HOLDER']

SubElement(entry, 'source',
attrib={'url': url_for('syndicate.get_syndicate_feed', syndicate_type='syndicate', _external=True, formatter='rss')}).text = \
attrib={'url': feed_url}).text = \
complete_item.get('source', '')

if complete_item.get('pubstatus') == 'usable':
Expand Down

0 comments on commit b826fb4

Please sign in to comment.