Projet

Général

Profil

0001-dataviz-ignore-bad-statistics-provider-result-71963.patch

Thomas Noël, 02 décembre 2022 11:39

Télécharger (978 octets)

Voir les différences:

Subject: [PATCH] dataviz: ignore bad statistics provider result (#71963)

 combo/apps/dataviz/utils.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
combo/apps/dataviz/utils.py
1
import json
2

  
1 3
import django
2 4
from django.conf import settings
3 5

  
......
31 33
            if response.status_code != 200:
32 34
                continue
33 35

  
34
            result = response.json()
36
            try:
37
                result = response.json()
38
            except json.JSONDecodeError:
39
                continue
35 40
            if isinstance(result, dict):
36 41
                result = result['data']  # detect new api
37 42

  
38
-