diff --git a/weather.py b/weather.py index 24326a0..ad92091 100644 --- a/weather.py +++ b/weather.py @@ -102,7 +102,10 @@ class WeatherApi: units = user_preferences[nick]['units'] if nick in user_preferences.keys() else 'metric' 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 current_url = f"{self.weather_api_url}/current.json?key={self.api_key}&q={location}&qai=no"