yf_yzl 2 лет назад
Родитель
Сommit
e36936464c
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      apps/apply_weather.py

+ 2 - 1
apps/apply_weather.py

@@ -83,7 +83,8 @@ class GetWeather(APIView):
                     result = cursor.fetchone()
             if result:
                 try:
-                    result = json.loads(result[0])
+                    temp = result[0].replace("'", '"')
+                    result = json.loads(temp)
                     return Response({"content": result, "msg": "success", "code": 200})
                 except Exception as e:
                     logging.info(e)