Fix issue where custom job name was being ignored

This commit is contained in:
Brett Williams
2024-08-04 11:47:56 -05:00
parent 220b3fcc25
commit 86977b9d6d
3 changed files with 20 additions and 17 deletions

View File

@@ -49,12 +49,11 @@ def handle_uploaded_project_files(request, jobs_list, upload_directory):
raise ValueError(f"Error downloading file from URL: {project_url}")
elif local_path and os.path.exists(local_path):
referred_name = os.path.basename(local_path)
else:
raise ValueError("Cannot find any valid project paths")
# Prepare the local filepath
cleaned_path_name = os.path.splitext(referred_name)[0].replace(' ', '_')
cleaned_path_name = jobs_list[0].get('name', os.path.splitext(referred_name)[0]).replace(' ', '-')
job_dir = os.path.join(upload_directory, '-'.join(
[datetime.now().strftime("%Y.%m.%d_%H.%M.%S"), renderer, cleaned_path_name]))
os.makedirs(job_dir, exist_ok=True)