Skip to content

Commit

Permalink
Merge pull request #314 from nyejon/master
Browse files Browse the repository at this point in the history
Fix opencage reverse issue
  • Loading branch information
DenisCarriere committed Nov 9, 2017
2 parents 59cb6e4 + 45a2dcd commit 2795fda
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions geocoder/opencage.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,9 +412,10 @@ def _catch_errors(self, json_response):
def _adapt_results(self, json_response):
# special license attribute
self.license = json_response['licenses']
# self.rate['remaining'] returns the number of API queries available on
# your API Key
self.rate = json_response['rate']
# Shows the limit and how many remaining calls you have on your
# API Key
self.remaining_api_calls = json_response['rate']['remaining']
self.limit_api_calls = json_response['rate']['limit']
# return geo results
return json_response['results']

Expand Down
2 changes: 1 addition & 1 deletion geocoder/opencage_reverse.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class OpenCageReverse(OpenCageQuery):
def _build_params(self, location, provider_key, **kwargs):
location = Location(location)
return {
'query': self.location,
'query': location,
'key': provider_key,
}

Expand Down

0 comments on commit 2795fda

Please sign in to comment.