]> git.parisson.com Git - telemeta.git/commitdiff
fix item path during import
authorGuillaume Pellerin <yomguy@parisson.com>
Thu, 7 May 2015 08:01:18 +0000 (10:01 +0200)
committerGuillaume Pellerin <yomguy@parisson.com>
Thu, 7 May 2015 08:01:18 +0000 (10:01 +0200)
telemeta/management/commands/telemeta-import-collections-from-crem.py

index ccd0e1b2aa7998a39e470b2a6b929596b20c762c..ebd712387ec4affc0b27d3d589fef8ca8c9b5764 100644 (file)
@@ -93,7 +93,7 @@ class Command(BaseCommand):
                     f.close()
                 else:
                     print "file in MEDIA_ROOT, linking..."
-                    path = media[len(self.media_root):]
+                    path = media.replace(self.media_root, '')
                     if not self.dry_run:
                         item.file = path
                         item.save()