Skip to content

Commit

Permalink
Dedupe images for Guidebook ZIP export
Browse files Browse the repository at this point in the history
For guests and bands, which only have one image, we were writing the same image twice -- this should fix that.
  • Loading branch information
kitsuta committed Dec 21, 2024
1 parent 2ed7115 commit b147b9b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion uber/site_sections/schedule_reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,12 @@ def export_guidebook_zip(self, zip_file, session, selected_model, new_only=False
if new_only:
query = query.filter(filters[0])

written_files = []

for model in query:
filenames, files = getattr(model, 'guidebook_images', ['', ''])

for filename, file in zip(filenames, files):
if filename:
if filename and not filename in written_files:
written_files.append(filename)
zip_file.write(getattr(file, 'filepath', getattr(file, 'pic_fpath', None)), filename)

0 comments on commit b147b9b

Please sign in to comment.