Telemeta icon indicating copy to clipboard operation
Telemeta copied to clipboard

ValueError: The 'file' attribute has no file associated with it.

Open yomguy opened this issue 6 years ago • 3 comments

Traceback (most recent call last):

  File "/opt/miniconda/lib/python2.7/site-packages/django/core/handlers/base.py", line 112, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)

  File "/srv/src/telemeta/telemeta/views/collection.py", line 134, in related_media_collection_stream
    response = serve_media(media.file.path, content_type=media.mime_type)

  File "/opt/miniconda/lib/python2.7/site-packages/django/db/models/fields/files.py", line 58, in _get_path
    self._require_file()

  File "/opt/miniconda/lib/python2.7/site-packages/django/db/models/fields/files.py", line 41, in _require_file
    raise ValueError("The '%s' attribute has no file associated with it." % self.field.name)

ValueError: The 'file' attribute has no file associated with it.

yomguy avatar Oct 06 '17 10:10 yomguy

path:/archives/collections/CNRSMH_I_2011_015/related/1374/view/

yomguy avatar Oct 06 '17 10:10 yomguy

The related media is empty:

for related in collection.related.all():
    print "ID: %s , Title: %s, file : %s" % (related.id, related.title, related.file)

ID: 1373 , Title: Cahier d'enregistrements, file : items/2015/07/10/Carnet_Rec_1991_total.pdf ID: 1374 , Title: , file :

thomasfillon avatar Oct 06 '17 11:10 thomasfillon

related media with ID 1374 from collection CNRSMH_I_2011_015 is empty except for the mime_type field = application/pdf

thomasfillon avatar Oct 06 '17 12:10 thomasfillon