--- a/src/iconolab/management/commands/importimages.py Wed Aug 01 18:36:38 2018 +0200
+++ b/src/iconolab/management/commands/importimages.py Wed Aug 01 19:05:27 2018 +0200
@@ -6,6 +6,7 @@
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from django.db import transaction
+from django.utils import text
from PIL import Image as ImagePIL
from sorl.thumbnail import get_thumbnail
@@ -18,7 +19,10 @@
raise NotImplementedError
def get_image_dir(self, natural_key, collection):
- return os.path.join(collection.name, natural_key)
+ return os.path.join(
+ collection.name,
+ text.get_valid_filename(natural_key.replace('|', '__'))
+ )
##
def create_item_and_metadata(