Code

Opened 5 years ago

Closed 5 years ago

Last modified 3 years ago

#11103 closed (fixed)

AttributeError: 'ImageFieldFile' object has no attribute 'name'

Reported by: anonymous Owned by: nobody
Component: Database layer (models, ORM) Version: master
Severity: Keywords: ImageFieldFile
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description (last modified by Alex)

Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/django/core/servers/basehttp.py", line 278, in run
    self.result = application(self.environ, self.start_response)
  File "/usr/lib/python2.6/dist-packages/django/core/servers/basehttp.py", line 636, in __call__
    return self.application(environ, start_response)
  File "/usr/lib/python2.6/dist-packages/django/core/handlers/wsgi.py", line 245, in __call__
    response = middleware_method(request, response)
  File "/usr/lib/python2.6/dist-packages/django/contrib/sessions/middleware.py", line 36, in process_response
    request.session.save()
  File "/usr/lib/python2.6/dist-packages/django/contrib/sessions/backends/db.py", line 53, in save
    session_data = self.encode(self._get_session(no_load=must_create)),
  File "/usr/lib/python2.6/dist-packages/django/contrib/sessions/backends/base.py", line 88, in encode
    pickled = pickle.dumps(session_dict, pickle.HIGHEST_PROTOCOL)
  File "/usr/lib/python2.6/dist-packages/django/db/models/fields/files.py", line 139, in __getstate__
    return {'name': self.name, 'closed': False, '_committed': True, '_file': None}

Attachments (0)

Change History (8)

comment:1 Changed 5 years ago by anonymous

  • Component changed from File uploads/storage to Database layer (models, ORM)
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 5 years ago by Alex

  • Description modified (diff)

Fixed formatting.

comment:3 Changed 5 years ago by anonymous

  • milestone set to 1.2

comment:4 Changed 5 years ago by gwilson

(In [10860]) Added test for pickling of a model with an ImageField, refs #11103.

comment:5 Changed 5 years ago by gwilson

  • Resolution set to fixed
  • Status changed from new to closed

Is this still an issue for you? I could not reproduce the error, and added a test in [10860] that passes here.

comment:6 Changed 5 years ago by gwilson

  • milestone changed from 1.2 to 1.1

comment:7 Changed 5 years ago by ccahoon

(In [10989]) Added test for pickling of a model with an ImageField, refs #11103.

comment:8 Changed 3 years ago by jacob

  • milestone 1.1 deleted

Milestone 1.1 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.