fix: ordered fields on get_list returning list (#25663)

* fix: ordered `fields` on get_list returning list

* chore: linters
This commit is contained in:
Dany Robert 2024-03-27 10:41:09 +05:30 committed by GitHub
parent b0da61413c
commit 6e02df7ea2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -133,6 +133,8 @@ class DatabaseQuery:
limit_page_length = page_length
if limit:
limit_page_length = limit
if as_list and not isinstance(self.fields, (list | tuple)) and len(self.fields) > 1:
frappe.throw(_("Fields must be a list or tuple when as_list is enabled"))
self.filters = filters or []
self.or_filters = or_filters or []