]> git.parisson.com Git - telemeta.git/commitdiff
item files of collection zipstream packages get the item code instead of original...
authorGuillaume Pellerin <yomguy@parisson.com>
Wed, 19 Mar 2014 21:31:18 +0000 (22:31 +0100)
committerGuillaume Pellerin <yomguy@parisson.com>
Wed, 19 Mar 2014 21:31:18 +0000 (22:31 +0100)
telemeta/views/collection.py

index fc311359a17405260ea0b17e0a98e441b92e44b5..5f0b7cf92c40762e8cfcf2d0bb5660a4eb7f6702 100644 (file)
@@ -191,8 +191,8 @@ class CollectionPackageView(View):
         z.write(path, arcname=collection.public_id + os.sep + filename)
 
         for item in collection.items.all():
-            filename = item.file.path.split(os.sep)[-1]
-            z.write(item.file.path, arcname=collection.public_id + os.sep + filename)
+            filename, ext = os.splitext(item.file.path.split(os.sep)[-1])
+            z.write(item.file.path, arcname=collection.public_id + os.sep + item.code + ext)
             marker_view = MarkerView()
             markers = marker_view.get_markers(item.id)
             if markers: