Skip to content

Commit

Permalink
Fix api
Browse files Browse the repository at this point in the history
  • Loading branch information
haneslinger committed Nov 28, 2023
1 parent 7b5994d commit 7ee6cfd
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions seed/views/v3/organizations.py
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,7 @@ def report(self, request, pk=None):
cycles = Cycle.objects.filter(id__in=params["cycle_ids"])
data = self.get_raw_report_data(pk, cycles, params['x_var'], params['y_var'])
data = {
"chart_data": [d["chart_data"] for d in data],
"chart_data": sum([d["chart_data"] for d in data], []),
"property_counts": [d["property_counts"] for d in data]
}

Expand Down Expand Up @@ -950,14 +950,6 @@ def report_aggregated(self, request, pk=None):
cycles = Cycle.objects.filter(id__in=params["cycle_ids"])
data = self.get_raw_report_data(pk, cycles, params["x_var"], params["y_var"])

# error if empty
empty = all([d['property_counts']['num_properties_w-data'] == 0 for d in data])
if empty:
return Response(
{'status': 'error', 'message': 'No data found'},
status=status.HTTP_200_OK
)

chart_data = []
property_counts = []
for datum in data:
Expand Down

0 comments on commit 7ee6cfd

Please sign in to comment.