Commit 2e39131b by David Ormsbee

Tiny fix to handle when data_or_params isn't passed in

parent ebf971fa
...@@ -20,6 +20,8 @@ def merge_dict(dic1, dic2): ...@@ -20,6 +20,8 @@ def merge_dict(dic1, dic2):
return dict(dic1.items() + dic2.items()) return dict(dic1.items() + dic2.items())
def perform_request(method, url, data_or_params=None, *args, **kwargs): def perform_request(method, url, data_or_params=None, *args, **kwargs):
if data_or_params is None:
data_or_params = {}
data_or_params['api_key'] = settings.API_KEY data_or_params['api_key'] = settings.API_KEY
if method in ['post', 'put', 'patch']: if method in ['post', 'put', 'patch']:
response = requests.request(method, url, data=data_or_params) response = requests.request(method, url, data=data_or_params)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment