From 4fc38b92420c65310ec0ba91a38119062c930941 Mon Sep 17 00:00:00 2001 From: Abdul Manan Date: Fri, 18 Oct 2024 04:25:35 +0500 Subject: [PATCH] Updated site creation to only use supported themes. --- .../edly_credentials_app/api/v1/constants.py | 6 ++++++ .../edly_credentials_app/api/v1/views/edly_sites.py | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/credentials/apps/edx_credentials_extensions/edly_credentials_app/api/v1/constants.py b/credentials/apps/edx_credentials_extensions/edly_credentials_app/api/v1/constants.py index 793c035ae..853546b8b 100644 --- a/credentials/apps/edx_credentials_extensions/edly_credentials_app/api/v1/constants.py +++ b/credentials/apps/edx_credentials_extensions/edly_credentials_app/api/v1/constants.py @@ -20,3 +20,9 @@ ] EDLY_PANEL_WORKER_USER = 'edly_panel_worker' + +AVAILABLE_THEMES = [ + 'openedx' +] + +DEFAULT_THEME = 'openedx' diff --git a/credentials/apps/edx_credentials_extensions/edly_credentials_app/api/v1/views/edly_sites.py b/credentials/apps/edx_credentials_extensions/edly_credentials_app/api/v1/views/edly_sites.py index e7ce6185f..7636542e7 100644 --- a/credentials/apps/edx_credentials_extensions/edly_credentials_app/api/v1/views/edly_sites.py +++ b/credentials/apps/edx_credentials_extensions/edly_credentials_app/api/v1/views/edly_sites.py @@ -9,7 +9,7 @@ from credentials.apps.core.models import SiteConfiguration from credentials.apps.edx_credentials_extensions.edly_credentials_app.api.permissions import CanAccessSiteCreation -from credentials.apps.edx_credentials_extensions.edly_credentials_app.api.v1.constants import ERROR_MESSAGES +from credentials.apps.edx_credentials_extensions.edly_credentials_app.api.v1.constants import ERROR_MESSAGES, AVAILABLE_THEMES, DEFAULT_THEME from credentials.apps.edx_credentials_extensions.edly_credentials_app.helpers import ( get_credentials_site_configuration, validate_site_configurations, @@ -72,7 +72,7 @@ def process_client_sites_setup(self): edx_org_short_name=edly_slug, platform_name=self.request.data.get('platform_name', ''), company_name=self.request.data.get('platform_name', ''), - theme_name=theme_dir_name, + theme_name=theme_dir_name if theme_dir_name in AVAILABLE_THEMES else DEFAULT_THEME, lms_url_root=lms_url_root, catalog_api_url=catalog_api_url, tos_url='{lms_url_root}/tos'.format(lms_url_root=lms_url_root),