|
@@ -255,7 +255,6 @@ class AllLocationSummary(APIView):
|
|
|
return Response({'error': 'No location Found'}, status=status.HTTP_400_BAD_REQUEST)
|
|
|
locations = Location.objects.all()
|
|
|
review_counts = []
|
|
|
- max_rev = 0
|
|
|
for location in locations:
|
|
|
loc_json = {
|
|
|
'name': location.care_name,
|
|
@@ -270,13 +269,9 @@ class AllLocationSummary(APIView):
|
|
|
location.last_week_neg_yelp_review_count
|
|
|
]
|
|
|
}
|
|
|
- _temp_max = max(loc_json['positive']+loc_json['negative'])
|
|
|
- if _temp_max > max_rev:
|
|
|
- max_rev = _temp_max
|
|
|
review_counts.append(loc_json)
|
|
|
response = {
|
|
|
'labels': ['Google', 'Facebook', 'Yelp'],
|
|
|
'review_counts': review_counts,
|
|
|
- 'max_rev_count': max_rev,
|
|
|
}
|
|
|
return Response(response)
|