Skip to content

Commit

Permalink
Stop refetch_legacy_news_and_events pulling from the defunct legacy site
Browse files Browse the repository at this point in the history
  • Loading branch information
alxbridge committed Jan 22, 2025
1 parent 2ac0993 commit 4fd91a9
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions rca/utils/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from wagtail.search import index
from wagtail.snippets.models import register_snippet

from rca.api_content.content import CantPullFromRcaApi, pull_tagged_news_and_events
from rca.api_content.content import CantPullFromRcaApi
from rca.utils.cache import get_default_cache_control_decorator
from rca.utils.forms import RCAPageAdminForm

Expand Down Expand Up @@ -655,14 +655,14 @@ def legacy_news_cache_key(self):

def refetch_legacy_news_and_events(self):
"""
Fetches the related news and events for this page from
the legacy site. The result is cached to reduce real-time
calls to the legacy API.
Method which used to fetch related news and events from
the legacy site. This site is now defunct, so this method
is no longer expected to return anything.
TODO: remove this and other references in the codebase to
it or to the legacy news and events content
"""
tags = self.legacy_news_and_event_tags.all().values_list("name", flat=True)
value = pull_tagged_news_and_events(*tags)
cache.set(self.legacy_news_cache_key, value, None)
return value
return []

@cached_property
def legacy_news_and_events(self):
Expand Down

0 comments on commit 4fd91a9

Please sign in to comment.