Skip to content

Commit 1589371

Browse files
committed
use qualname_from_function
1 parent 176a660 commit 1589371

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

sentry_sdk/integrations/django/tasks.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import sentry_sdk
44
from sentry_sdk.consts import OP
55
from sentry_sdk.tracing import SPANSTATUS
6+
from sentry_sdk.utils import qualname_from_function
67

78
try:
89
# django.tasks were added in Django 6.0
@@ -32,9 +33,7 @@ def _sentry_enqueue(self, *args, **kwargs):
3233
if integration is None:
3334
return old_task_enqueue(self, *args, **kwargs)
3435

35-
name = (
36-
getattr(self.func, "__name__", repr(self.func)) or "<unknown Django task>"
37-
)
36+
name = qualname_from_function(self.func) or "<unknown Django task>"
3837

3938
with sentry_sdk.start_span(
4039
op=OP.QUEUE_SUBMIT_DJANGO, name=name, origin=DjangoIntegration.origin

0 commit comments

Comments
 (0)