Skip to content

Commit f5a5900

Browse files
committed
.
1 parent fcf8a24 commit f5a5900

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sentry_sdk/integrations/django/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,9 +417,11 @@ def _set_transaction_name_and_source(scope, transaction_style, request):
417417
if isinstance(handler, str):
418418
scope.set_transaction_name(handler)
419419
else:
420-
scope.set_transaction_name(
421-
transaction_from_function(getattr(handler, "view_class", handler))
420+
name = transaction_from_function(
421+
getattr(handler, "view_class", handler)
422422
)
423+
if isinstance(name, str):
424+
scope.set_transaction_name(name)
423425
except Exception:
424426
pass
425427

0 commit comments

Comments
 (0)