Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Commit

Permalink
fix handling fail
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerwoud committed Mar 11, 2024
1 parent f01fed9 commit d53eef1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion backend/project/endpoints/projects/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def post(self):

# save the file that is given with the request

new_project, _ = create_model_instance(
new_project, status_code = create_model_instance(
Project,
project_json,
urljoin(f"{API_URL}/", "/projects"),
Expand All @@ -62,6 +62,9 @@ def post(self):
"archieved"]
)

if status_code == 400:
return new_project, status_code

project_upload_directory = os.path.join(f"{UPLOAD_FOLDER}", f"{new_project.project_id}")

os.makedirs(project_upload_directory, exist_ok=True)
Expand Down

0 comments on commit d53eef1

Please sign in to comment.