diff --git a/fleet_management/tasks.py b/fleet_management/tasks.py index 1d50db6..96dd088 100644 --- a/fleet_management/tasks.py +++ b/fleet_management/tasks.py @@ -50,7 +50,8 @@ def get_trips_for_device(): 'deviceId': dev['id'], 'from': (datetime.now() - timedelta(days=1)).strftime('%Y-%m-%dT23:00:00.000Z'), 'to': datetime.now().strftime('%Y-%m-%dT22:59:59.999Z') - } + }, + headers={'Accept': 'application/json'} ) trips_response.raise_for_status() except requests.HTTPError as e: @@ -58,6 +59,8 @@ def get_trips_for_device(): except Exception as e: frappe.throw(f"Error fetching trips: {e}") + print(trips_response.text) + #if len(trips_response.json()) > 0: # for debug in trips_response.json(): # print(f"Distance: {debug['distance']} | Average Speed: {debug['averageSpeed']}")