0002-toulouse_smart-remove-unnused-timeout-parameter-from.patch
passerelle/contrib/toulouse_smart/models.py | ||
---|---|---|
113 | 113 |
{ |
114 | 114 |
'id': '', |
115 | 115 |
'text': _('Service is unavailable'), |
116 | 116 |
'disabled': True, |
117 | 117 |
} |
118 | 118 |
] |
119 | 119 |
} |
120 | 120 | |
121 |
def request(self, url, json=None, timeout=None):
|
|
121 |
def request(self, url, json=None): |
|
122 | 122 |
headers = {'Accept': 'application/json'} |
123 | 123 |
try: |
124 | 124 |
if json: |
125 | 125 |
headers['Content-Type'] = 'application/json' |
126 |
response = self.requests.post(url, headers=headers, timeout=timeout, json=json)
|
|
126 |
response = self.requests.post(url, headers=headers, json=json) |
|
127 | 127 |
else: |
128 |
response = self.requests.get(url, headers=headers, timeout=timeout)
|
|
128 |
response = self.requests.get(url, headers=headers) |
|
129 | 129 |
response.raise_for_status() |
130 | 130 |
except RequestException as e: |
131 | 131 |
raise APIError('failed to %s %s: %s' % ('post' if json else 'get', url, e)) |
132 | 132 |
return response |
133 | 133 | |
134 | 134 |
@endpoint( |
135 | 135 |
name='get-intervention', |
136 | 136 |
methods=['get'], |
137 |
- |