Skip to content

Commit

Permalink
Fix json response
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbertoMoreta committed May 22, 2024
1 parent 04bdd93 commit bb260e7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/views/app_links.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import json
import os

from django.conf import settings
Expand All @@ -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)

0 comments on commit bb260e7

Please sign in to comment.