Skip to content

Commit

Permalink
Exclude macos metadata folder (#467)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmihalik authored Dec 13, 2024
1 parent c9c18cc commit a222838
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion competition/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,15 @@ def upload_solutions_with_points(self, request, pk=None):
errors = []

# TODO: checks file are really pdfs
for filename in filter(lambda filename: filename.endswith('.pdf'), zfile.namelist()):
for filename in zfile.namelist():
if not filename.endswith(".pdf"):
# Ignore other non-pdf files in the archive
continue

if "__MACOSX" in filename:
# Ignore mac os metadata folder
continue

try:
parts = filename.rstrip('.pdf').split('-')
score = int(parts[0])
Expand Down

0 comments on commit a222838

Please sign in to comment.