Skip to content
This repository was archived by the owner on Jan 13, 2022. It is now read-only.

Commit 75fe793

Browse files
committed
Merge pull request #92 from thelinuxkid/master
Show error instead of boolean in exception & add signed header to subscriptions
2 parents d5730dc + c5fb9a9 commit 75fe793

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

instagram/bind.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def _do_api_request(self, url, method="GET", body=None, headers=None):
134134
if content_obj.get('code') == 420 or content_obj.get('code') == 429:
135135
error_message = content_obj.get('error_message') or "Your client is making too many request per second"
136136
raise InstagramAPIError(content_obj.get('code'), "Rate limited", error_message)
137-
raise InstagramAPIError(content_obj.has_key('code'), content_obj.has_key('error_type'), content_obj.has_key('error_message'))
137+
raise InstagramAPIError(content_obj.get('code'), content_obj.get('error_type'), content_obj.get('error_message'))
138138

139139
api_responses = []
140140
status_code = content_obj['meta']['code']

instagram/client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,12 +224,14 @@ def _make_subscription_action(method, include=None, exclude=None):
224224
accepts_parameters.extend(include)
225225
if exclude:
226226
accepts_parameters = [x for x in accepts_parameters if x not in exclude]
227+
signature = False if method == 'GET' else True
227228
return bind_method(
228229
path="/subscriptions",
229230
method=method,
230231
accepts_parameters=accepts_parameters,
231232
include_secret=True,
232-
objectify_response=False
233+
objectify_response=False,
234+
signature=signature,
233235
)
234236

235237
create_subscription = _make_subscription_action('POST')

0 commit comments

Comments
 (0)