yf_yzl преди 2 години
родител
ревизия
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)