Skip to content

Commit 1396903

Browse files
committed
Fix groups example
If the demo user does not have permissions to be in groups, then the initial :meth:`Client.groups()` call in :func:`run_groups_example()` will fail. Move this call inside the try-block to have this example get skipped when the user does not have the correct permissions.
1 parent 9a979ee commit 1396903

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

demo/example.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,9 @@ def run_groups_example(client):
160160
- Remove a member from a group
161161
- Delete a Group
162162
"""
163-
original_groups = client.groups()
164-
165163
try:
166164
# First delete group if it already exists
165+
original_groups = client.groups()
167166
_delete_leftover_group(original_groups, 'box_sdk_demo_group')
168167
_delete_leftover_group(original_groups, 'renamed_box_sdk_demo_group')
169168

0 commit comments

Comments
 (0)