Skip to content

Commit

Permalink
Fix bug #1068
Browse files Browse the repository at this point in the history
  • Loading branch information
Alejandro Casanovas committed Apr 22, 2024
1 parent 855dfc2 commit cbe92b7
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions O365/drive.py
Original file line number Diff line number Diff line change
Expand Up @@ -1065,10 +1065,6 @@ def get_items(self, limit=None, *, query=None, order_by=None, batch=None):
params['$orderby'] = order_by

if query:
# if query.has_filters:
# warnings.warn('Filters are not allowed by the '
# 'Api Provider in this method')
# query.clear_filters()
if isinstance(query, str):
params['$filter'] = query
else:
Expand Down Expand Up @@ -1107,7 +1103,8 @@ def get_child_folders(self, limit=None, *, query=None, order_by=None, batch=None
"""

if query:
query = query.on_attribute('folder').unequal(None)
if not isinstance(query, str):
query = query.on_attribute('folder').unequal(None)
else:
query = self.q('folder').unequal(None)

Expand Down Expand Up @@ -1211,14 +1208,14 @@ def search(self, search_text, limit=None, *, query=None, order_by=None,
params['$orderby'] = order_by

if query:
if query.has_filters:
warnings.warn(
'Filters are not allowed by the Api '
'Provider in this method')
query.clear_filters()
if isinstance(query, str):
params['$filter'] = query
else:
if query.has_filters:
warnings.warn(
'Filters are not allowed by the Api '
'Provider in this method')
query.clear_filters()
params.update(query.as_params())

response = self.con.get(url, params=params)
Expand Down

0 comments on commit cbe92b7

Please sign in to comment.