Opened 7 years ago

Last modified 7 years ago

#28325 closed Bug

ImageFile extesion validation fails with: AttributeError: 'list' object has no attribute 'name' — at Version 1

Reported by: Maximilian Kindshofer Owned by: nobody
Component: File uploads/storage Version: 1.11
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 (last modified by Tim Graham)

I upgraded from 1.11 from 1.10 and I get following error

AttributeError: 'list' object has no attribute 'name'
  File "django/core/handlers/exception.py", line 41, in inner
    response = get_response(request)
  File "django/core/handlers/base.py", line 249, in _legacy_get_response
    response = self._get_response(request)
  File "django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "auftragsverwaltung/views.py", line 292, in bilddokumentation_form
    if formset.is_valid():
  File "django/forms/formsets.py", line 321, in is_valid
    self.errors
  File "django/forms/formsets.py", line 295, in errors
    self.full_clean()
  File "django/forms/formsets.py", line 348, in full_clean
    self._errors.append(form.errors)
  File "django/forms/forms.py", line 175, in errors
    self.full_clean()
  File "django/forms/forms.py", line 386, in full_clean
    self._post_clean()
  File "django/forms/models.py", line 396, in _post_clean
    self.instance.full_clean(exclude=exclude, validate_unique=False)
  File "django/db/models/base.py", line 1226, in full_clean
    self.clean_fields(exclude=exclude)
  File "django/db/models/base.py", line 1268, in clean_fields
    setattr(self, f.attname, f.clean(raw_value, self))
  File "django/db/models/fields/__init__.py", line 603, in clean
    self.run_validators(value)
  File "django/db/models/fields/__init__.py", line 555, in run_validators
    v(value)
  File "django/core/validators.py", line 476, in __call__
    extension = os.path.splitext(value.name)[1][1:].lower()

self:	
<django.core.validators.FileExtensionValidator object at 0x7fee879c6828>
value:	
[
<InMemoryUploadedFile: 20170619_150207.jpg (image/jpeg)>
]

Change History (1)

comment:1 by Tim Graham, 7 years ago

Description: modified (diff)

Could you please give steps to reproduce the problem?

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