Skip to content

Commit e1e9918

Browse files
committed
🐛(backend) Fix unreachable exception handler for URLValidator
The exception block was never being executed because URLValidator raises django.core.exceptions.ValidationError, not drf.exceptions.ValidationError. Signed-off-by: Mohamed El Amine BOUKERFA <boukerfa.ma@gmail.com>
1 parent 4b4319d commit e1e9918

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/backend/core/api/viewsets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2135,7 +2135,7 @@ def cors_proxy(self, request, *args, **kwargs):
21352135
url_validator = URLValidator(schemes=["http", "https"])
21362136
try:
21372137
url_validator(url)
2138-
except drf.exceptions.ValidationError as e:
2138+
except ValidationError as e:
21392139
return drf.response.Response(
21402140
{"detail": str(e)},
21412141
status=drf.status.HTTP_400_BAD_REQUEST,

0 commit comments

Comments
 (0)