Parisson / Telemeta

Collaborative content management system for musicology
http://telemeta.org
GNU Affero General Public License v3.0
118 stars 38 forks source link

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

Open yomguy opened 6 years ago

yomguy commented 6 years ago
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 commented 6 years ago

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

thomasfillon commented 6 years ago

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 commented 6 years ago

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