Skip to content

Commit

Permalink
Issue mozilla-mobile#25: Refactor yelp resolution so can do with key …
Browse files Browse the repository at this point in the history
…(not just url).
  • Loading branch information
mcomella committed Jan 25, 2017
1 parent 67c1c99 commit 5a0aa9e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/providers/yelp.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@

idPattern = re.compile("/([^/\?]*)(\?.*)?$")


def resolve_with_key(key):
key = key.encode('utf-8').strip()
return yelp3Client.request("/businesses/{0}".format(key))


def resolve(idObj):
key = slug(idObj["url"])
key = key.encode('utf-8').strip()
return yelp3Client.request("/businesses/{0}".format(key))
return resolve_with_key(key)

0 comments on commit 5a0aa9e

Please sign in to comment.