Skip to content

Commit

Permalink
remove files from tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
Mobmaker55 committed Sep 6, 2024
1 parent b78f86a commit 788b8f1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions conditional/blueprints/major_project_submission.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,10 @@ def submit_major_project(user_dict=None):
bucket = s3.create_bucket(Bucket="major-project-media")
# Collect all the locally cached files and put them in the bucket
for file in os.listdir(f"/tmp/{user_dict['username']}"):
print(file)
bucket.upload_file(f"/tmp/{user_dict['username']}/{file}", file)
os.remove(file)
filepath = f"/tmp/{user_dict['username']}/{file}"
print(filepath)
bucket.upload_file(filepath, f"{project.id}-{file}")
os.remove(filepath)
os.rmdir(f"/tmp/{user_dict['username']}")

username = user_dict['username']
Expand Down

0 comments on commit 788b8f1

Please sign in to comment.