Skip to content

Commit

Permalink
use SHARE_WEB_URL, not SHARE_API_URL for feeds
Browse files Browse the repository at this point in the history
  • Loading branch information
aaxelb committed Apr 15, 2021
1 parent 94000a9 commit 4a2f392
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions api/views/feeds.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def parse_date(s):

class MetadataRecordsRSS(Feed):
_share_index_key = 'BACKCOMPAT_INDEX' # TODO remove when we drop legacy feeds
link = '{}api/v2/feeds/rss/'.format(settings.SHARE_API_URL)
link = '{}api/v2/feeds/rss/'.format(settings.SHARE_WEB_URL)
description = 'Updates to the SHARE open dataset'
author_name = 'SHARE'

Expand Down Expand Up @@ -104,7 +104,7 @@ def item_description(self, item):

def item_link(self, item):
# Link to SHARE curate page
return '{}{}/{}'.format(settings.SHARE_API_URL, item.get('type').replace(' ', ''), item.get('id'))
return '{}{}/{}'.format(settings.SHARE_WEB_URL, item.get('type').replace(' ', ''), item.get('id'))

def item_author_name(self, item):
contributor_list = item.get('lists', []).get('contributors', [])
Expand Down Expand Up @@ -137,13 +137,13 @@ class MetadataRecordsAtom(MetadataRecordsRSS):
_share_index_key = 'BACKCOMPAT_INDEX' # TODO remove when we drop legacy feeds
feed_type = Atom1Feed
subtitle = MetadataRecordsRSS.description
link = '{}api/v2/feeds/atom/'.format(settings.SHARE_API_URL)
link = '{}api/v2/feeds/atom/'.format(settings.SHARE_WEB_URL)


# TODO remove when we drop legacy feeds
class LegacyCreativeWorksRSS(MetadataRecordsRSS):
_share_index_key = 'LEGACY_INDEX' # TODO remove when we drop legacy feeds
link = '{}api/v2/rss/'.format(settings.SHARE_API_URL)
link = '{}api/v2/rss/'.format(settings.SHARE_WEB_URL)

def __call__(self, request, *args, **kwargs):
if not settings.SHARE_LEGACY_PIPELINE:
Expand All @@ -157,7 +157,7 @@ def __call__(self, request, *args, **kwargs):
# TODO remove when we drop legacy feeds
class LegacyCreativeWorksAtom(MetadataRecordsAtom):
_share_index_key = 'LEGACY_INDEX' # TODO remove when we drop legacy feeds
link = '{}api/v2/atom/'.format(settings.SHARE_API_URL)
link = '{}api/v2/atom/'.format(settings.SHARE_WEB_URL)

def __call__(self, request, *args, **kwargs):
if not settings.SHARE_LEGACY_PIPELINE:
Expand Down

0 comments on commit 4a2f392

Please sign in to comment.