0xffan commited on
Commit
e4ba296
·
1 Parent(s): 575aa0f

Issue fixes

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -51,8 +51,9 @@ def get_aqi(city:str, state:str, country:str)-> str:
51
  response = requests.request("GET", url, headers=headers, data=payload)
52
 
53
  data_json = response.json()
54
- if data_json.status == "success":
55
- return f"The current air quality in {city} is {data_json.current.pollution.aqius}."
 
56
  else:
57
  return "No air quality data was fetched.";
58
 
 
51
  response = requests.request("GET", url, headers=headers, data=payload)
52
 
53
  data_json = response.json()
54
+ if data_json["status"] == "success":
55
+ aqius = data_json["current"]["pollution"]["aqius"]
56
+ return f"The current air quality in {city} is {aqius}."
57
  else:
58
  return "No air quality data was fetched.";
59