[MIG] maintenance_service_http_monitoring: Migration to 18.0

This commit is contained in:
Stéphan Sainléger
2026-03-17 22:01:39 +01:00
parent 8558f5b79f
commit 9897d7ebe8
6 changed files with 11 additions and 73 deletions

View File

@@ -42,7 +42,7 @@ class ServiceInstance(models.Model):
now = fields.Datetime.now()
url = rec.service_url
if not url.lower().startswith("https://"):
url = "https://" + url.lstrip("http://")
url = "https://" + url.removeprefix("http://").removeprefix("HTTP://")
try:
response = requests.get(url, timeout=HTTP_CHECK_TIMEOUT)
status_code = response.status_code