Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
yomguy opened this issue Oct 6, 2017 · 3 comments
Open

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

yomguy opened this issue Oct 6, 2017 · 3 comments
Assignees
Labels
Milestone

Comments

@yomguy
Copy link
Member

yomguy commented Oct 6, 2017

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 yomguy added the bug label Oct 6, 2017
@yomguy yomguy self-assigned this Oct 6, 2017
@yomguy
Copy link
Member Author

yomguy commented Oct 6, 2017

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

@thomasfillon
Copy link
Member

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
Copy link
Member

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

@yomguy yomguy added this to the 1.8 milestone May 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants