fix(with_comment_count): handle string values

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
This commit is contained in:
Akhil Narang 2025-12-18 18:11:02 +05:30
parent c0ebc96597
commit 3a2dcaa2de
No known key found for this signature in database
GPG key ID: 9DCC61E211BF645F

View file

@ -12,6 +12,7 @@ from frappe.deprecation_dumpster import deprecation_warning
from frappe.model.utils import is_virtual_doctype from frappe.model.utils import is_virtual_doctype
from frappe.model.utils.user_settings import get_user_settings, update_user_settings from frappe.model.utils.user_settings import get_user_settings, update_user_settings
from frappe.query_builder.utils import Column from frappe.query_builder.utils import Column
from frappe.utils import sbool
class DatabaseQuery: class DatabaseQuery:
@ -211,7 +212,7 @@ class DatabaseQuery:
result = query.run(debug=debug, as_dict=not as_list, update=update) result = query.run(debug=debug, as_dict=not as_list, update=update)
# Add comment count if requested and not as_list # Add comment count if requested and not as_list
if with_comment_count and not as_list and self.doctype: if sbool(with_comment_count) and not as_list and self.doctype:
self._add_comment_count(result) self._add_comment_count(result)
# Save user settings if requested # Save user settings if requested