(app_configs, **kwargs)
| 237 | |
| 238 | |
| 239 | def check_middleware(app_configs, **kwargs): |
| 240 | errors = [] |
| 241 | |
| 242 | login_required_index = _subclass_index( |
| 243 | "django.contrib.auth.middleware.LoginRequiredMiddleware", |
| 244 | settings.MIDDLEWARE, |
| 245 | ) |
| 246 | |
| 247 | if login_required_index != -1: |
| 248 | auth_index = _subclass_index( |
| 249 | "django.contrib.auth.middleware.AuthenticationMiddleware", |
| 250 | settings.MIDDLEWARE, |
| 251 | ) |
| 252 | if auth_index == -1 or auth_index > login_required_index: |
| 253 | errors.append( |
| 254 | checks.Error( |
| 255 | "In order to use django.contrib.auth.middleware." |
| 256 | "LoginRequiredMiddleware, django.contrib.auth.middleware." |
| 257 | "AuthenticationMiddleware must be defined before it in MIDDLEWARE.", |
| 258 | id="auth.E013", |
| 259 | ) |
| 260 | ) |
| 261 | return errors |
nothing calls this directly
no test coverage detected