File tree Expand file tree Collapse file tree
sentry_sdk/integrations/django
tests/integrations/django Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -479,38 +479,32 @@ def _after_get_response(request: "WSGIRequest") -> None:
479479 elif is_lazy :
480480 return
481481
482- if (
483- user is None
484- or not is_authenticated (user )
485- or type (scope .streamed_span ) is not StreamedSpan
486- ):
482+ if user is None or not is_authenticated (user ):
487483 return
488484
489- segment_span = scope .streamed_span ._segment
490-
491485 user_id = None
492486 try :
493487 user_id = str (user .pk )
494488 except Exception :
495489 pass
496490 if user_id is not None :
497- segment_span .set_attribute (SPANDATA .USER_ID , user_id )
491+ scope .set_attribute (SPANDATA .USER_ID , user_id )
498492
499493 user_email = None
500494 try :
501495 user_email = user .email
502496 except Exception :
503497 pass
504498 if user_email is not None :
505- segment_span .set_attribute (SPANDATA .USER_EMAIL , user_email )
499+ scope .set_attribute (SPANDATA .USER_EMAIL , user_email )
506500
507501 username = None
508502 try :
509503 username = user .get_username ()
510504 except Exception :
511505 pass
512506 if username is not None :
513- segment_span .set_attribute (SPANDATA .USER_NAME , username )
507+ scope .set_attribute (SPANDATA .USER_NAME , username )
514508
515509
516510def _patch_get_response () -> None :
Original file line number Diff line number Diff line change @@ -532,7 +532,7 @@ def test_user_captured(
532532
533533@pytest .mark .forked
534534@pytest_mark_django_db_decorator ()
535- def test_materialized_user_captured_on_segment_span (
535+ def test_materialized_user_captured (
536536 sentry_init ,
537537 client ,
538538 capture_events ,
You can’t perform that action at this time.
0 commit comments