500 | | if user and user.is_active \ |
501 | | and 'django.contrib.sessions.middleware.SessionMiddleware' in settings.MIDDLEWARE_CLASSES: |
| 500 | sessions_enabled = False |
| 501 | if user and user.is_active: |
| 502 | from django.contrib.sessions.middleware import SessionMiddleware |
| 503 | for middleware in settings.MIDDLEWARE_CLASSES: |
| 504 | try: |
| 505 | mod, dot, klass_name = middleware.rpartition('.') |
| 506 | mod = import_module(mod) |
| 507 | if issubclass(getattr(mod, klass_name, None), SessionMiddleware): |
| 508 | sessions_enabled = True |
| 509 | break |
| 510 | except ImportError: |
| 511 | continue |
| 512 | if sessions_enabled: |