merge photolog subfolder patch
This commit is contained in:
parent
31cac27ece
commit
93c4e2a0b9
1 changed files with 1 additions and 9 deletions
|
@ -166,14 +166,6 @@ def upload_photos_to_site(site: Site, zip: zipfile.ZipFile, gallery: Gallery, ph
|
|||
logger.debug(f'Ignoring file "{filename}".')
|
||||
continue
|
||||
|
||||
if os.path.dirname(filename):
|
||||
logger.warning('Ignoring file "{}" as it is in a subfolder; all images should be in the top '
|
||||
'folder of the zip.'.format(filename))
|
||||
upload_messages.append(UploadMessage.warning(
|
||||
_('Ignoring file "{filename}" as it is in a subfolder; all images should be in the top folder of the '
|
||||
'zip.').format(filename=filename)))
|
||||
continue
|
||||
|
||||
data = zip.read(filename)
|
||||
|
||||
if not len(data):
|
||||
|
@ -213,7 +205,7 @@ def upload_photos_to_site(site: Site, zip: zipfile.ZipFile, gallery: Gallery, ph
|
|||
continue
|
||||
|
||||
contentfile = ContentFile(data)
|
||||
photo.image.save(filename, contentfile)
|
||||
photo.image.save(os.path.basename(filename), contentfile)
|
||||
photo.save()
|
||||
photo.sites.add(site)
|
||||
gallery.photos.add(photo)
|
||||
|
|
Loading…
Add table
Reference in a new issue