From e82053ee432a059bde6fa48814f394e0e51380b4 Mon Sep 17 00:00:00 2001 From: Afzal Wali Date: Fri, 21 Jul 2017 18:25:19 +0500 Subject: [PATCH] Clearing the cache if the site's configuration was removed. The site's configuration does not contain the API URL, it should not keep on displayed the old cached list of uuids. LEARNER-1146 --- .../djangoapps/catalog/management/commands/cache_programs.py | 1 + 1 file changed, 1 insertion(+) diff --git a/openedx/core/djangoapps/catalog/management/commands/cache_programs.py b/openedx/core/djangoapps/catalog/management/commands/cache_programs.py index fc8c86316d..9276c94a4b 100644 --- a/openedx/core/djangoapps/catalog/management/commands/cache_programs.py +++ b/openedx/core/djangoapps/catalog/management/commands/cache_programs.py @@ -50,6 +50,7 @@ class Command(BaseCommand): site_config = getattr(site, 'configuration', None) if site_config is None or not site_config.get_value('COURSE_CATALOG_API_URL'): logger.info('Skipping site {domain}. No configuration.'.format(domain=site.domain)) + cache.set(SITE_PROGRAM_UUIDS_CACHE_KEY_TPL.format(domain=site.domain), [], None) continue client = create_catalog_api_client(user, site=site)