mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-29 04:54:00 +03:00
Drop redundant requests adapter (#4639)
This commit is contained in:
parent
7eb6cdca00
commit
5c54b227c1
|
@ -106,15 +106,6 @@ if requests is not None:
|
||||||
def close(self):
|
def close(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
class NoExternalRequestsAdapter(requests.adapters.HTTPAdapter):
|
|
||||||
def send(self, request, *args, **kwargs):
|
|
||||||
msg = (
|
|
||||||
'RequestsClient refusing to make an outgoing network request '
|
|
||||||
'to "%s". Only "testserver" or hostnames in your ALLOWED_HOSTS '
|
|
||||||
'setting are valid.' % request.url
|
|
||||||
)
|
|
||||||
raise RuntimeError(msg)
|
|
||||||
|
|
||||||
class RequestsClient(requests.Session):
|
class RequestsClient(requests.Session):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super(RequestsClient, self).__init__(*args, **kwargs)
|
super(RequestsClient, self).__init__(*args, **kwargs)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user