|
@ -120,11 +120,14 @@ class YandexConnectRequest(object): |
|
|
if not url.endswith('/'): |
|
|
if not url.endswith('/'): |
|
|
url = '%s/' % url |
|
|
url = '%s/' % url |
|
|
|
|
|
|
|
|
if data: |
|
|
if data and isinstance(data, dict): |
|
|
for key in list(data): |
|
|
for key in list(data): |
|
|
if data[key] is None or (isinstance(data[key], dict) and not data[key]): |
|
|
if data[key] is None or (isinstance(data[key], dict) and not data[key]): |
|
|
del data[key] |
|
|
del data[key] |
|
|
continue |
|
|
continue |
|
|
|
|
|
if 'id' in data and type(data['id']) is not int: |
|
|
|
|
|
data['id'] = int(data['id']) |
|
|
|
|
|
|
|
|
method = method.lower() |
|
|
method = method.lower() |
|
|
if method not in ['get', 'post', 'patch', 'delete']: |
|
|
if method not in ['get', 'post', 'patch', 'delete']: |
|
|
raise ValueError('Not right method') |
|
|
raise ValueError('Not right method') |
|
|