Skip to content

Commit

Permalink
Merge pull request #1439 from burnash/fix/protected-range-warnings
Browse files Browse the repository at this point in the history
Allow "warning" type protected ranges
  • Loading branch information
alifeee authored Mar 17, 2024
2 parents 719619f + f7b506a commit 3e5ca62
Show file tree
Hide file tree
Showing 5 changed files with 1,791 additions and 3 deletions.
6 changes: 4 additions & 2 deletions gspread/worksheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -2037,7 +2037,7 @@ def insert_cols(
def add_protected_range(
self,
name: str,
editor_users_emails: Sequence[str],
editor_users_emails: Sequence[str] = [],
editor_groups_emails: Sequence[str] = [],
description: Optional[str] = None,
warning_only: bool = False,
Expand Down Expand Up @@ -2091,7 +2091,9 @@ def add_protected_range(
"description": description,
"warningOnly": warning_only,
"requestingUserCanEdit": requesting_user_can_edit,
"editors": {
"editors": None
if warning_only
else {
"users": editor_users_emails,
"groups": editor_groups_emails,
},
Expand Down
Loading

0 comments on commit 3e5ca62

Please sign in to comment.