diff --git a/competition/views.py b/competition/views.py index 2555b67..a4e43ee 100644 --- a/competition/views.py +++ b/competition/views.py @@ -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])