correcting some if-else syntax
This commit is contained in:
parent
6afeec78e9
commit
a39664a813
@ -102,7 +102,10 @@ class WeatherApi:
|
|||||||
units = user_preferences[nick]['units'] if nick in user_preferences.keys() else 'metric'
|
units = user_preferences[nick]['units'] if nick in user_preferences.keys() else 'metric'
|
||||||
|
|
||||||
if not location:
|
if not location:
|
||||||
location = user_preferences[nick]['location'] if user_preferences[nick]['location'] else raise NoDefaultLocation()
|
if user_preferences[nick]['location']:
|
||||||
|
location = user_preferences[nick]['location']
|
||||||
|
else:
|
||||||
|
raise NoDefaultLocation()
|
||||||
|
|
||||||
# URL for current conditions
|
# URL for current conditions
|
||||||
current_url = f"{self.weather_api_url}/current.json?key={self.api_key}&q={location}&qai=no"
|
current_url = f"{self.weather_api_url}/current.json?key={self.api_key}&q={location}&qai=no"
|
||||||
|
Loading…
Reference in New Issue
Block a user