Opened 12 years ago

Last modified 12 years ago

#18674 closed Bug

Session app triggers an AttributeError — at Initial Version

Reported by: loic@… Owned by: nobody
Component: contrib.sessions Version: 1.4
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I suspect this occurs when session has expired, or something similar and may be related to a change of API in django 1.4:

AttributeError at /
'QuerySet' object has no attribute '_prefetch_related_lookups'

Environment:

Request Method: GET

Django Version: 1.4
Python Version: 2.7.3
Installed Applications:
('django.contrib.auth',

'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'xxx'
'django.contrib.admin')

Installed Middleware:
('django.middleware.common.CommonMiddleware',

'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware')

Traceback:
File "xxx/Django/django/core/handlers/base.py" in get_response

  1. response = middleware_method(request, response)

File "xxx/Django/django/contrib/sessions/middleware.py" in process_response

  1. request.session.save()

File "xxx/Django/django/contrib/sessions/backends/db.py" in save

  1. session_data=self.encode(self._get_session(no_load=must_create)),

File "xxx/Django/django/contrib/sessions/backends/base.py" in encode

  1. pickled = pickle.dumps(session_dict, pickle.HIGHEST_PROTOCOL)

File "xxx/Django/django/db/models/query.py" in getstate

  1. len(self)

File "xxx/Django/django/db/models/query.py" in len

  1. if self._prefetch_related_lookups and not self._prefetch_done:

Exception Type: AttributeError at /
Exception Value: 'QuerySet' object has no attribute '_prefetch_related_lookups'

DB is MySQL.

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top