Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: there is no .info file for extracted files #50

Merged
merged 1 commit into from
Apr 26, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions bananas_api/web_routes/new.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,15 @@ async def new_delete_file(request):
if session is None:
return web.HTTPNotFound()

for file_info in session["files"]:
for file_info in list(session["files"]):
if file_info["uuid"] == file_uuid:
session["files"].remove(file_info)
TrueBrain marked this conversation as resolved.
Show resolved Hide resolved

internal_filename = file_info["internal_filename"]
os.remove(internal_filename)
os.remove(f"{internal_filename}.info")
session["files"].remove(file_info)
if not internal_filename.startswith("data/tar/"):
os.remove(f"{internal_filename}.info")

break
else:
return web.HTTPNotFound()
Expand Down