Skip to content

Commit

Permalink
Do not expose validation error in the response
Browse files Browse the repository at this point in the history
  • Loading branch information
mathjazz committed Dec 5, 2023
1 parent 4b44870 commit c3e3e3b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pontoon/contributors/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)

Expand Down

0 comments on commit c3e3e3b

Please sign in to comment.