From bb260e78634ffff9a23365f5e3fac210c8753c1b Mon Sep 17 00:00:00 2001 From: Alberto Moreta Date: Thu, 23 May 2024 00:19:45 +0200 Subject: [PATCH] Fix json response --- core/views/app_links.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/views/app_links.py b/core/views/app_links.py index 157948d..9f57ef3 100644 --- a/core/views/app_links.py +++ b/core/views/app_links.py @@ -1,3 +1,4 @@ +import json import os from django.conf import settings @@ -15,8 +16,8 @@ def get(self, request, *args, **kwargs): try: with open(assetlinks_path, 'r') as file: - file_content = file.read() + file_content = json.loads(file.read()) except Exception as e: return JsonResponse({'error': f"An error occurred: {e}"}, status=500) - return JsonResponse({'file_content': file_content}) + return JsonResponse(file_content, safe=False)