10000 Fix #206 · urshala/google-cloud-python@e906938 · GitHub
[go: up one dir, main page]

Skip to content

Commit e906938

Browse files
author
Alejandro Casanovas
committed
1 parent d6af0dc commit e906938

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

O365/sharepoint.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,8 @@ def get_lists(self):
377377
return [self.list_constructor(parent=self, **{self._cloud_data_key: lst}) for lst in data.get('value', [])]
378378

379379
def get_list_by_name(self, display_name):
380-
""" Returns a sharepoint list based on the display name of the list
380+
"""
381+
Returns a sharepoint list based on the display name of the list
381382
"""
382383

383384
if not display_name:

O365/utils/utils.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -512,14 +512,17 @@ def __next__(self):
512512
data = data.get('value', [])
513513
if self.constructor:
514514
# Everything from cloud must be passed as self._cloud_data_key
515-
if callable(self.constructor) and not isinstance(self.constructor,
516-
type):
517-
self.data = [self.constructor(value)(parent=self.parent, **{
518-
self._cloud_data_key: value}, **self.extra_args) for value in data]
515+
self.data = []
516+
kwargs = {}
517+
kwargs.update(self.extra_args)
518+
if callable(self.constructor) and not isinstance(self.constructor, type):
519+
for value in data:
520+
kwargs[self._cloud_data_key] = value
521+
self.data.append(self.constructor(value)(parent=self.parent, **kwargs))
519522
else:
520-
self.data = [self.constructor(parent=self.parent,
521-
**{self._cloud_data_key: value}, **self.extra_args)
522-
for value in data]
523+
for value in data:
524+
kwargs[self._cloud_data_key] = value
525+
self.data.append(self.constructor(parent=self.parent, **kwargs))
523526
else:
524527
self.data = data
525528

0 commit comments

Comments
 (0)
0