diff --git a/cms/models.py b/cms/models.py index ad14e38935..7ee18b5226 100644 --- a/cms/models.py +++ b/cms/models.py @@ -750,25 +750,35 @@ def products(self): return page_data def get_context(self, request, *args, **kwargs): + hubspot_portal_id = settings.HUBSPOT_PORTAL_ID + hubspot_home_page_form_guid = settings.HUBSPOT_HOME_PAGE_FORM_GUID + if request.user.is_authenticated: - user = request.user.email + user = request.user.id else: if "anonymous_session_id" not in request.session: request.session["anonymous_session_id"] = str(uuid.uuid4()) user = request.session["anonymous_session_id"] - hubspot_portal_id = settings.HUBSPOT_PORTAL_ID - hubspot_home_page_form_guid = settings.HUBSPOT_HOME_PAGE_FORM_GUID + show_new_featured_carousel = features.is_enabled( - features.ENABLE_NEW_HOME_PAGE_FEATURED, False, user + features.ENABLE_NEW_HOME_PAGE_FEATURED, + False, + user, ) show_new_design_hero = features.is_enabled( - features.ENABLE_NEW_HOME_PAGE_HERO, False, user + features.ENABLE_NEW_HOME_PAGE_HERO, + False, + user, ) show_home_page_video_component = features.is_enabled( - features.ENABLE_NEW_HOME_PAGE_VIDEO, False, user + features.ENABLE_NEW_HOME_PAGE_VIDEO, + False, + user, ) show_home_page_contact_form = features.is_enabled( - features.ENABLE_NEW_HOME_PAGE_CONTACT_FORM, False, user + features.ENABLE_NEW_HOME_PAGE_CONTACT_FORM, + False, + user, ) return { diff --git a/cms/models_test.py b/cms/models_test.py index bce68bfb06..dcafd9b14f 100644 --- a/cms/models_test.py +++ b/cms/models_test.py @@ -170,8 +170,16 @@ def test_course_page_context( member.linked_instructor_page for member in course_page.linked_instructors.order_by("order").all() ], - "new_design": features.is_enabled("mitxonline-new-product-page"), - "new_footer": features.is_enabled("mitxonline-new-footer"), + "new_design": features.is_enabled( + "mitxonline-new-product-page", + False, + request.user.id if request.user.is_authenticated else "anonymousUser", + ), + "new_footer": features.is_enabled( + "mitxonline-new-footer", + False, + request.user.id if request.user.is_authenticated else "anonymousUser", + ), } context = course_page.get_context(request=request) diff --git a/cms/templates/product_page.html b/cms/templates/product_page.html index 831cb59f57..b3e4e6c3ae 100644 --- a/cms/templates/product_page.html +++ b/cms/templates/product_page.html @@ -118,6 +118,7 @@

Who can take this course?

{% if page.is_program_page %} {% endif %} +
diff --git a/frontend/public/src/components/AnonymousMenu.js b/frontend/public/src/components/AnonymousMenu.js index 574e439d8e..db23b3303a 100644 --- a/frontend/public/src/components/AnonymousMenu.js +++ b/frontend/public/src/components/AnonymousMenu.js @@ -12,7 +12,7 @@ type Props = { const AnonymousMenu = ({ mobileView }: Props) => { const identifierPostfix = mobileView ? "Mobile" : "Desktop" - const newDesign = checkFeatureFlag("mitxonline-new-header") + const newDesign = checkFeatureFlag("mitxonline-new-header", "anonymousUser") return (