From 229dbe0905f0c236655ac42001fafea9d8e72abd Mon Sep 17 00:00:00 2001 From: Hao Liu Date: Tue, 14 Mar 2023 15:43:56 -0400 Subject: [PATCH] Add ui_next to /api/v2/config - Add ui_next to /api/v2/config - enable banner to show up for normal user since /api/v2/settings is only available to admin users --- awx/api/views/root.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/awx/api/views/root.py b/awx/api/views/root.py index 7211600a37..7b4eb8191e 100644 --- a/awx/api/views/root.py +++ b/awx/api/views/root.py @@ -272,6 +272,9 @@ class ApiV2ConfigView(APIView): pendo_state = settings.PENDO_TRACKING_STATE if settings.PENDO_TRACKING_STATE in ('off', 'anonymous', 'detailed') else 'off' + # Guarding against settings.UI_NEXT being set to a non-boolean value + ui_next_state = settings.UI_NEXT if settings.UI_NEXT in (True, False) else False + data = dict( time_zone=settings.TIME_ZONE, license_info=license_data, @@ -280,6 +283,7 @@ class ApiV2ConfigView(APIView): analytics_status=pendo_state, analytics_collectors=all_collectors(), become_methods=PRIVILEGE_ESCALATION_METHODS, + ui_next=ui_next_state, ) # If LDAP is enabled, user_ldap_fields will return a list of field