Skip to content

Commit

Permalink
[weather] Fix error when asking for another user's weather
Browse files Browse the repository at this point in the history
  • Loading branch information
embolalia committed Mar 2, 2013
1 parent c0493ab commit d86481c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion weather.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand Down

0 comments on commit d86481c

Please sign in to comment.