fix(controllers): guard empty group-by detail row in trends

With an explicit GROUP BY, a zero-match detail query returns no rows (the old bare aggregate returned one all-NULL row), so row1[0][0] would raise IndexError. Skip the entry instead.
This commit is contained in:
Mihir Kandoi
2026-07-05 15:10:32 +05:30
parent 17851ceaae
commit 5d56a04a84

View File

@@ -203,6 +203,9 @@ def get_data(filters, conditions):
as_list=1,
)
if not row1:
continue
des[ind] = row[i][0]
des[ind - 1] = row1[0][0]