Skip to content

Commit d2a5ef9

Browse files
authored
Merge pull request #281 from grafana/fix-exception-handling-on-debug-277
Log exception traceback if DEBUG is enabled
2 parents 11b97be + 7ad9817 commit d2a5ef9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

django_saml2_auth/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from typing import (Any, Callable, Dict, Iterable, Mapping, Optional, Tuple,
1010
Union)
1111

12+
from dictor import dictor # type: ignore
1213
from django.conf import settings
1314
from django.http import HttpRequest, HttpResponse, HttpResponseRedirect
1415
from django.shortcuts import render
@@ -152,7 +153,7 @@ def handle_exception(exc: Exception, request: HttpRequest) -> HttpResponse:
152153
HttpResponse: Rendered error page with details
153154
"""
154155
logger = logging.getLogger(__name__)
155-
if getattr(settings.SAML2_AUTH, "DEBUG", False):
156+
if dictor(settings.SAML2_AUTH, "DEBUG", False):
156157
# Log the exception with traceback
157158
logger.exception(exc)
158159
else:

0 commit comments

Comments
 (0)