Skip to content

Commit

Permalink
add enrollment_unversal_prompt_enabled to admin api settings (#258)
Browse files Browse the repository at this point in the history
  • Loading branch information
chisuloAtDisco committed Mar 18, 2024
1 parent 6683995 commit 06b5a0c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions duo_client/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
'email_activity_notification_enabled': <bool:can users get activity notifications via email>,
'push_activity_notification_enabled': <bool:can users get activity notifications via Duo Mobile>,
'unenrolled_user_lockout_threshold': <int:days until a user will be locked out due to being unenrolled>,
'enrollment_universal_prompt_enabled': <bool:will email enrollment use Universal Prompt experience>,
}
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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 = <int:number of days>|0|None
enrollment_universal_prompt_enabled = True|False|None
Returns updated settings object.
Expand Down Expand Up @@ -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")
Expand Down
2 changes: 2 additions & 0 deletions tests/admin/test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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',
})

0 comments on commit 06b5a0c

Please sign in to comment.