Description
Environment
SaaS (https://sentry.io/)
Steps to Reproduce
Versions:
Django
: 4.2.15uwsgi
: 2.0.24sentry-sdk
: 2.13.0django-otp
: 1.5.1
-
Setup
django-otp
: https://django-otp-official.readthedocs.io/en/stable/overview.html#installation -
Use
django_otp.admin.OTPAdminSite
as custom admin site.# urls.py from django_otp.admin import OTPAdminSite admin_site = OTPAdminSite() urlpatterns = [path("admin/, admin_site.urls),]
-
Enable profiling by setting
profiles_sample_rate
insentry_sdk.init
. -
When the
uwsgi
server starts, the first request to the admin fails with the error:'User' object has no attribute 'is_verified'
-
If you remove the
profiles_sample_rate
fromsentry_sdk.init
, the error goes away.
Expected Result
Profiling should not change the behaviour of middleware so I would expect django_otp.middleware.OTPMiddleware
to set the is_verified
attribute on the User
object successfully.
Actual Result
django_otp.middleware.OTPMiddleware
somehow cannot set User.is_verified
for the first request in the admin. Consequent calls works fine, but only the initial request to admin fails.
Product Area
Profiling
Link
No response
DSN
No response
Version
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
Status