From d86481cc4b4516d9832c8a6e7fb8be2a9c993edd Mon Sep 17 00:00:00 2001 From: Edward Powell Date: Sat, 2 Mar 2013 11:23:32 -0500 Subject: [PATCH] [weather] Fix error when asking for another user's weather Issue #197 --- weather.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/weather.py b/weather.py index 3789013363..dc8f382cc7 100644 --- a/weather.py +++ b/weather.py @@ -134,7 +134,10 @@ def weather(willie, trigger): return willie.msg(trigger.sender, "I don't know where you live. " + 'Give me a location, like .weather London, or tell me where you live by saying .setlocation London, for example.') else: - woeid = woeid_search(location).find('woeid').text + if willie.db and location in willie.db.preferences: + woeid = willie.db.preferences.get(location, 'woeid') + else: + woeid = woeid_search(location).find('woeid').text if not woeid: return willie.reply("I don't know where that is.")