Заменил код вызывающий ошибку

This commit is contained in:
Данил 2024-10-21 22:02:50 +03:00
parent bcdf26416a
commit 825d667c25

View file

@ -2,7 +2,6 @@ import httpx
import yaml
from user_agents import parse as ua_parse
from http import HTTPStatus
config = yaml.safe_load(open('../config.yaml'))
@ -13,7 +12,7 @@ class PlausibleAnalytics:
user_agent = request.headers.get('user-agent', 'unknown')
user_agent_parsed = ua_parse(user_agent)
if HTTPStatus(response.status_code).is_client_error:
if 400 <= response.status_code < 500:
return
event = {