Skip to content

Commit d8f816d

Browse files
committed
we provide params via construct_request_kwargs now
1 parent 2a123b6 commit d8f816d

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

redminelib/engines/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,12 @@ def construct_request_kwargs(self, method, headers, params, data):
6060
:param data: (required). Data to send in the body of the request.
6161
:type data: dict, bytes or file-like object
6262
"""
63-
6463
kwargs = dict(self.requests, **{'data': data or {}, 'params': params or {}, 'headers': headers or {}})
6564

6665
if method in ('post', 'put', 'patch') and 'Content-Type' not in kwargs['headers']:
6766
kwargs['data'] = json.dumps(data)
6867
kwargs['headers']['Content-Type'] = 'application/json'
68+
6969
return kwargs
7070

7171
def request(self, method, url, headers=None, params=None, data=None):

redminelib/engines/sync.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,7 @@
1010
class SyncEngine(BaseEngine):
1111
@staticmethod
1212
def create_session(**params):
13-
session = requests.Session()
14-
15-
for param in params:
16-
setattr(session, param, params[param])
17-
18-
return session
13+
return requests.Session()
1914

2015
def process_bulk_request(self, method, url, container, bulk_params):
2116
return [resource for params in bulk_params for resource in self.request(method, url, params=params)[container]]

0 commit comments

Comments
 (0)