Pathlibfix
This commit is contained in:
parent
5b50ecf922
commit
c50f0e5cfa
1 changed files with 1 additions and 1 deletions
|
|
@ -186,7 +186,7 @@ class GalleryDownload(LoginRequiredMixin, DetailView):
|
|||
gallery_year = Path("/photos/" + str(+gallery.date_start.year))
|
||||
gallery_zip = gallery_year / (gallery.slug + ".zip")
|
||||
|
||||
with open(settings.MEDIA_ROOT / gallery_zip, "wb") as zip_bytes:
|
||||
with open(settings.MEDIA_ROOT + str(gallery_zip), "wb") as zip_bytes: # I hate pathlib
|
||||
zip_file = zipfile.ZipFile(zip_bytes, "w")
|
||||
for photo in gallery.photos.filter(is_public=True):
|
||||
filename = os.path.basename(os.path.normpath(photo.image.path))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue