From ecf96d4263b53b8ded2383af384b8f66ba395286 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Thu, 15 Jan 2015 11:53:23 +0100 Subject: [PATCH] fix collection related media id --- telemeta/views/collection.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/telemeta/views/collection.py b/telemeta/views/collection.py index 1f3ea11b..227a7760 100644 --- a/telemeta/views/collection.py +++ b/telemeta/views/collection.py @@ -141,15 +141,15 @@ class CollectionView(object): collection.delete() return redirect('telemeta-collections') - def related_media_collection_stream(self, request, collection_public_id, media_id): - collection = MediaCollection.objects.get(public_id=collection_public_id) + def related_media_collection_stream(self, request, public_id, media_id): + collection = MediaCollection.objects.get(public_id=public_id) media = MediaCollectionRelated.objects.get(collection=collection, id=media_id) response = HttpResponse(stream_from_file(media.file.path), mimetype=media.mime_type) # response['Content-Disposition'] = 'attachment' return response - def related_media_collection_download(self, request, collection_public_id, media_id): - collection = MediaCollection.objects.get(public_id=collection_public_id) + def related_media_collection_download(self, request, public_id, media_id): + collection = MediaCollection.objects.get(public_id=public_id) media = MediaCollectionRelated.objects.get(collection=collection, id=media_id) filename = media.file.path.split(os.sep)[-1] response = HttpResponse(stream_from_file(media.file.path), mimetype=media.mime_type) -- 2.39.5