diff --git a/pontoon/contributors/views.py b/pontoon/contributors/views.py index 91e3a91105..4c2a4fda8d 100644 --- a/pontoon/contributors/views.py +++ b/pontoon/contributors/views.py @@ -1,4 +1,5 @@ import json +import logging from dateutil.relativedelta import relativedelta from django.contrib import messages @@ -26,6 +27,9 @@ from pontoon.uxactionlog.utils import log_ux_action +log = logging.getLogger(__name__) + + @login_required(redirect_field_name="", login_url="/403") def profile(request): """Current user profile.""" @@ -210,9 +214,11 @@ def toggle_theme(request, username): profile.theme = theme profile.full_clean() profile.save() - except ValidationError: + except ValidationError as e: + error_message = f"User profile validation error: {e}" + log.error(error_message) return JsonResponse( - {"status": False, "message": "Bad Request: Invalid theme"}, + {"status": False, "message": error_message}, status=400, )