]> git.parisson.com Git - teleforma.git/commitdiff
fix get collection and item
authorGuillaume Pellerin <yomguy@parisson.com>
Tue, 31 Dec 2013 09:21:37 +0000 (10:21 +0100)
committerGuillaume Pellerin <yomguy@parisson.com>
Tue, 31 Dec 2013 09:21:37 +0000 (10:21 +0100)
teleforma/management/commands/teleforma-import-seminar-media.py

index 9ffbf759391a50eb24689c41f696c53458130eee..7697ddc61b5f1fec3894f2fcc2b430b805fb5eea 100644 (file)
@@ -157,9 +157,9 @@ class Command(BaseCommand):
                     if not exist:
                         logger.logger.info(seminar.public_url())
                         logger.logger.info(path)
-                        collections = MediaCollection.objects.get_or_create(code=collection_id)
+                        collection = MediaCollection.objects.get_or_create(code=collection_id)
                         item_id = '_'.join([period.name, collection_id, ext, str(media_rank)])
-                        items = MediaItem.objects.get_or_create(collection=collection, code=item_id)
+                        item = MediaItem.objects.get_or_create(collection=collection, code=item_id)
                         item.title = name
                         item.file = path
                         if os.path.getsize(root+os.sep+filename):