correcting some if-else syntax

This commit is contained in:
Mark McIntyre 2023-05-12 08:28:08 -04:00
parent 6afeec78e9
commit a39664a813

View File

@ -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"