diff --git a/pontoon/base/tests/test_middleware.py b/pontoon/base/tests/test_middleware.py index 2595fc8c6..e209893b2 100644 --- a/pontoon/base/tests/test_middleware.py +++ b/pontoon/base/tests/test_middleware.py @@ -72,6 +72,7 @@ def test_throttle(client, settings): @pytest.mark.django_db def test_AccountDisabledMiddleware(client, member, settings): # Ensure the user is authenticated but not active + member.user.is_authenticated = True member.user.is_active = False member.user.save() diff --git a/pontoon/settings/base.py b/pontoon/settings/base.py index 9b495aecc..0336bd9c5 100644 --- a/pontoon/settings/base.py +++ b/pontoon/settings/base.py @@ -329,13 +329,13 @@ def _default_from_email(): "django.middleware.common.CommonMiddleware", "django.contrib.sessions.middleware.SessionMiddleware", "django.contrib.auth.middleware.AuthenticationMiddleware", + "pontoon.base.middleware.AccountDisabledMiddleware", "pontoon.base.middleware.ThrottleIpMiddleware", "django.middleware.csrf.CsrfViewMiddleware", "django.contrib.messages.middleware.MessageMiddleware", "django.middleware.clickjacking.XFrameOptionsMiddleware", "csp.middleware.CSPMiddleware", "pontoon.base.middleware.EmailConsentMiddleware", - "pontoon.base.middleware.AccountDisabledMiddleware", ) CONTEXT_PROCESSORS = (