diff --git a/O365/drive.py b/O365/drive.py index fab501c9..000c7b86 100644 --- a/O365/drive.py +++ b/O365/drive.py @@ -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: @@ -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) @@ -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)