From 06b5a0c4cdad24ba1d6b002a1b01e8914438dfd9 Mon Sep 17 00:00:00 2001 From: Chisulo Mukabe <128819208+chisuloAtDisco@users.noreply.github.com> Date: Mon, 18 Mar 2024 12:17:55 -0400 Subject: [PATCH] add enrollment_unversal_prompt_enabled to admin api settings (#258) --- duo_client/admin.py | 7 +++++++ tests/admin/test_settings.py | 2 ++ 2 files changed, 9 insertions(+) diff --git a/duo_client/admin.py b/duo_client/admin.py index 6fb5b6c..ac98497 100644 --- a/duo_client/admin.py +++ b/duo_client/admin.py @@ -115,6 +115,7 @@ 'email_activity_notification_enabled': , 'push_activity_notification_enabled': , 'unenrolled_user_lockout_threshold': , + 'enrollment_universal_prompt_enabled': , } @@ -1987,6 +1988,7 @@ def update_settings(self, email_activity_notification_enabled=None, push_activity_notification_enabled=None, unenrolled_user_lockout_threshold=None, + enrollment_universal_prompt_enabled=None, ): """ Update settings. @@ -2029,6 +2031,7 @@ def update_settings(self, email_activity_notification_enabled = True|False|None push_activity_notification_enabled = True|False|None unenrolled_user_lockout_threshold = |0|None + enrollment_universal_prompt_enabled = True|False|None Returns updated settings object. @@ -2116,6 +2119,10 @@ def update_settings(self, params['unenrolled_user_lockout_threshold'] = str( unenrolled_user_lockout_threshold ) + if enrollment_universal_prompt_enabled is not None: + params['enrollment_universal_prompt_enabled'] = ( + '1' if enrollment_universal_prompt_enabled else '0' + ) if not params: raise TypeError("No settings were provided") diff --git a/tests/admin/test_settings.py b/tests/admin/test_settings.py index 908fec5..855525f 100644 --- a/tests/admin/test_settings.py +++ b/tests/admin/test_settings.py @@ -44,6 +44,7 @@ def test_update_settings(self): email_activity_notification_enabled=True, push_activity_notification_enabled=True, unenrolled_user_lockout_threshold=100, + enrollment_universal_prompt_enabled=True, ) response = response[0] self.assertEqual(response['method'], 'POST') @@ -85,4 +86,5 @@ def test_update_settings(self): 'email_activity_notification_enabled': '1', 'push_activity_notification_enabled': '1', 'unenrolled_user_lockout_threshold': '100', + 'enrollment_universal_prompt_enabled': '1', })