Don't crash on misspelled http/https in sponsor signup
authorMagnus Hagander <magnus@hagander.net>
Mon, 2 Jun 2025 09:34:15 +0000 (11:34 +0200)
committerMagnus Hagander <magnus@hagander.net>
Mon, 2 Jun 2025 09:34:15 +0000 (11:34 +0200)
Instead, give a proper error message.

postgresqleu/util/validators.py

index 0cc2026fc5c80bc1fb301b022d0fad8d3fd8e2d2..0bf11c875ae60ea24acfc2b4b5b0eb0a43b139f1 100644 (file)
@@ -54,6 +54,8 @@ def Http200Validator(value):
         raise ValidationError("Connection to server failed")
     except requests.exceptions.ReadTimeout:
         raise ValidationError("URL timed out")
+    except requests.exceptions.InvalidSchema:
+        raise ValidationError("Invalid schema in URL, please use http or https")
 
 
 def TwitterValidator(value):