forked from CGM_Public/pretix_original
Clean up monkeypatch code
This commit is contained in:
@@ -27,8 +27,5 @@ class PretixHelpersConfig(AppConfig):
|
|||||||
label = 'pretixhelpers'
|
label = 'pretixhelpers'
|
||||||
|
|
||||||
def ready(self):
|
def ready(self):
|
||||||
from .monkeypatching import (
|
from .monkeypatching import monkeypatch_all_at_ready
|
||||||
monkeypatch_all_at_ready, monkeypatch_requests_timeout,
|
|
||||||
)
|
|
||||||
monkeypatch_all_at_ready()
|
monkeypatch_all_at_ready()
|
||||||
monkeypatch_requests_timeout()
|
|
||||||
|
|||||||
@@ -69,11 +69,6 @@ def monkeypatch_pillow_safer():
|
|||||||
Image.ID.remove("EPS")
|
Image.ID.remove("EPS")
|
||||||
|
|
||||||
|
|
||||||
def monkeypatch_all_at_ready():
|
|
||||||
monkeypatch_vobject_performance()
|
|
||||||
monkeypatch_pillow_safer()
|
|
||||||
|
|
||||||
|
|
||||||
def monkeypatch_requests_timeout():
|
def monkeypatch_requests_timeout():
|
||||||
"""
|
"""
|
||||||
The requests package does not by default set a timeout for outgoing HTTP requests. This is dangerous especially since
|
The requests package does not by default set a timeout for outgoing HTTP requests. This is dangerous especially since
|
||||||
@@ -88,3 +83,9 @@ def monkeypatch_requests_timeout():
|
|||||||
return types.MethodType(old_httpadapter_send, self)(request, timeout=timeout, **kwargs)
|
return types.MethodType(old_httpadapter_send, self)(request, timeout=timeout, **kwargs)
|
||||||
|
|
||||||
HTTPAdapter.send = httpadapter_send
|
HTTPAdapter.send = httpadapter_send
|
||||||
|
|
||||||
|
|
||||||
|
def monkeypatch_all_at_ready():
|
||||||
|
monkeypatch_vobject_performance()
|
||||||
|
monkeypatch_pillow_safer()
|
||||||
|
monkeypatch_requests_timeout()
|
||||||
|
|||||||
Reference in New Issue
Block a user