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 28, 2017
1 parent 3e26b8c commit 0715b7a
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 0715b7a

Please sign in to comment.