fix: default analytic estimate points and sorting for custom analytics (#1066)
This commit is contained in:
parent
ab695a309f
commit
27626fb16f
2 changed files with 5 additions and 3 deletions
|
|
@ -261,11 +261,13 @@ class DefaultAnalyticsEndpoint(BaseAPIView):
|
|||
)
|
||||
|
||||
open_estimate_sum = (
|
||||
Issue.objects.filter(
|
||||
queryset.filter(
|
||||
state__group__in=["backlog", "unstarted", "started"]
|
||||
).aggregate(open_estimate_sum=Sum("estimate_point"))
|
||||
)["open_estimate_sum"]
|
||||
total_estimate_sum = Issue.objects.aggregate(
|
||||
print(open_estimate_sum)
|
||||
|
||||
total_estimate_sum = queryset.aggregate(
|
||||
total_estimate_sum=Sum("estimate_point")
|
||||
)["total_estimate_sum"]
|
||||
|
||||
|
|
|
|||
|
|
@ -72,5 +72,5 @@ def build_graph_plot(queryset, x_axis, y_axis, segment=None):
|
|||
order = ["low", "medium", "high", "urgent", "None"]
|
||||
sorted_data = {key: grouped_data[key] for key in order if key in grouped_data}
|
||||
else:
|
||||
sorted_data = dict(sorted(grouped_data.items(), key=lambda x: (x[0] is "None", x[0])))
|
||||
sorted_data = dict(sorted(grouped_data.items(), key=lambda x: (x[0] == "None", x[0])))
|
||||
return sorted_data
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue