Skip to content

Commit

Permalink
Fix issue with check all zip files
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenwardy committed Jul 8, 2024
1 parent e31433f commit 80c3416
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions app/tasks/importtasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,16 +342,15 @@ def check_zip_release(self, id, path):
def check_all_zip_files():
result = []

with get_temp_dir() as temp:
releases = PackageRelease.query.all()
for release in releases:
with ZipFile(release.file_path, 'r') as zf:
if not _check_zip_file(temp, zf):
print(f"Unsafe zip file for {release.package.get_id} at {release.file_path}", file=sys.stderr)
result.append({
"package": release.package.get_id(),
"file": release.file_path,
})
releases = PackageRelease.query.all()
for release in releases:
with ZipFile(release.file_path, 'r') as zf:
if not _check_zip_file("/tmp/example", zf):
print(f"Unsafe zip file for {release.package.get_id()} at {release.file_path}", file=sys.stderr)
result.append({
"package": release.package.get_id(),
"file": release.file_path,
})

return json.dumps(result)

Expand Down

0 comments on commit 80c3416

Please sign in to comment.