Skip to content

Commit

Permalink
switch back to json, fix linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
stitch committed Jun 18, 2024
1 parent 1645b05 commit 27d2a57
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions dashboard/internet_nl_dashboard/logic/report.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# SPDX-License-Identifier: Apache-2.0
import gzip
import json
import logging
import re
from copy import copy
Expand All @@ -8,7 +9,6 @@
from typing import Any, Dict, List, Optional, Type, Union
from uuid import uuid4

import orjson
from actstream import action
from django.db.models import Model # pylint: disable=unused-import
from django.db.models import Prefetch
Expand Down Expand Up @@ -114,7 +114,7 @@ def ad_hoc_tagged_report(account: Account, report_id: int, tags: List[str], at_w
f'"total_urls": {len(report.calculation["urls"])}, ' \
f'"is_publicly_shared": {"true" if report.is_publicly_shared else "false"}, ' \
f'"at_when": "{report.at_when}", ' \
f'"calculation": {orjson.dumps(report.calculation)}, ' \
f'"calculation": {json.dumps(report.calculation)}, ' \
f'"report_type": "{report.report_type}", ' \
f'"public_report_code": "{report.public_report_code}", ' \
f'"public_share_code": "{report.public_share_code}" ' \
Expand Down
7 changes: 3 additions & 4 deletions dashboard/internet_nl_dashboard/views/app.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import orjson
from django.http import HttpResponse
from django.http import JsonResponse
from django.views.decorators.cache import cache_page
from websecmap.app.constance import get_all_values

Expand All @@ -17,5 +16,5 @@ def config_content():


@cache_page(ONE_HOUR)
def config(request) -> HttpResponse:
return HttpResponse(orjson.dumps(config_content()), content_type="application/json", status=200)
def config(request) -> JsonResponse:
return JsonResponse(config_content(), status=200, safe=False)

0 comments on commit 27d2a57

Please sign in to comment.