From c3e3e3b218f119cafc38f97428fc69955fcf677b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matja=C5=BE=20Horvat?= Date: Tue, 5 Dec 2023 17:04:27 +0100 Subject: [PATCH] Do not expose validation error in the response --- pontoon/contributors/views.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pontoon/contributors/views.py b/pontoon/contributors/views.py index 4c2a4fda8d..34c07d9df6 100644 --- a/pontoon/contributors/views.py +++ b/pontoon/contributors/views.py @@ -215,10 +215,9 @@ def toggle_theme(request, username): profile.full_clean() profile.save() except ValidationError as e: - error_message = f"User profile validation error: {e}" - log.error(error_message) + log.error(f"User profile validation error: {e}") return JsonResponse( - {"status": False, "message": error_message}, + {"status": False, "message": "Bad Request: User profile validation failed"}, status=400, )