Skip to content

Commit cf6dc1a

Browse files
committed
Validates session workbook for update_range method
1 parent d515e49 commit cf6dc1a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

microsoftgraph/workbooks.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,10 +296,10 @@ def get_used_range(self, workbook_id: str, worksheet_id: str, **kwargs) -> Respo
296296
Response: Microsoft Graph Response.
297297
"""
298298
url = "me/drive/items/{}/workbook/worksheets/{}/usedRange".format(workbook_id, quote_plus(worksheet_id))
299-
300299
return self._client._get(self._client.base_url + url, **kwargs)
301300

302301
@token_required
302+
@workbook_session_id_required
303303
def update_range(self, workbook_id: str, worksheet_id: str, address: str, **kwargs) -> Response:
304304
"""Update the properties of range object.
305305
@@ -313,7 +313,8 @@ def update_range(self, workbook_id: str, worksheet_id: str, address: str, **kwar
313313
Returns:
314314
Response: Microsoft Graph Response.
315315
"""
316+
headers = {"workbook-session-id": self._client.workbook_session_id}
316317
url = "me/drive/items/{}/workbook/worksheets/{}/range(address='{}')".format(
317318
workbook_id, quote_plus(worksheet_id), address
318319
)
319-
return self._client._patch(self._client.base_url + url, **kwargs)
320+
return self._client._patch(self._client.base_url + url, headers=headers, **kwargs)

0 commit comments

Comments
 (0)