mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 10:31:09 -05:00
Add timeout to requests calls
This commit is contained in:
@@ -26,7 +26,7 @@ class TurnstileMixin:
|
||||
'remoteip': request.META.get('REMOTE_ADDR'),
|
||||
}
|
||||
|
||||
response = requests.post(settings.TURNSTILE_VERIFY_URL, data=data)
|
||||
response = requests.post(settings.TURNSTILE_VERIFY_URL, data=data, timeout=60)
|
||||
result = response.json()
|
||||
|
||||
if not result.get('success'):
|
||||
|
||||
@@ -31,7 +31,7 @@ def create_user_profile(sender, instance, created, **kwargs):
|
||||
|
||||
if avatar_url:
|
||||
try:
|
||||
response = requests.get(avatar_url)
|
||||
response = requests.get(avatar_url, timeout=60)
|
||||
if response.status_code == 200:
|
||||
img_temp = NamedTemporaryFile(delete=True)
|
||||
img_temp.write(response.content)
|
||||
|
||||
Reference in New Issue
Block a user