Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Alejandro Casanovas committed Mar 25, 2019
1 parent d6af0dc commit e906938
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
3 changes: 2 additions & 1 deletion O365/sharepoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,8 @@ def get_lists(self):
return [self.list_constructor(parent=self, **{self._cloud_data_key: lst}) for lst in data.get('value', [])]

def get_list_by_name(self, display_name):
""" Returns a sharepoint list based on the display name of the list
"""
Returns a sharepoint list based on the display name of the list
"""

if not display_name:
Expand Down
17 changes: 10 additions & 7 deletions O365/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,14 +512,17 @@ def __next__(self):
data = data.get('value', [])
if self.constructor:
# Everything from cloud must be passed as self._cloud_data_key
if callable(self.constructor) and not isinstance(self.constructor,
type):
self.data = [self.constructor(value)(parent=self.parent, **{
self._cloud_data_key: value}, **self.extra_args) for value in data]
self.data = []
kwargs = {}
kwargs.update(self.extra_args)
if callable(self.constructor) and not isinstance(self.constructor, type):
for value in data:
kwargs[self._cloud_data_key] = value
self.data.append(self.constructor(value)(parent=self.parent, **kwargs))
else:
self.data = [self.constructor(parent=self.parent,
**{self._cloud_data_key: value}, **self.extra_args)
for value in data]
for value in data:
kwargs[self._cloud_data_key] = value
self.data.append(self.constructor(parent=self.parent, **kwargs))
else:
self.data = data

Expand Down

0 comments on commit e906938

Please sign in to comment.