From 72b6ecf18c1c5032175e93181a77232ef280a1be Mon Sep 17 00:00:00 2001 From: William Stein Date: Thu, 11 Jul 2024 20:18:28 +0000 Subject: [PATCH] fix wrong implementation of creating project with license on the projects page - you MUST pass the license in when creating the project, **NOT** add the license later. --- src/packages/frontend/projects/actions.ts | 3 +++ src/packages/frontend/projects/create-project.tsx | 4 +--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/packages/frontend/projects/actions.ts b/src/packages/frontend/projects/actions.ts index d6550cfb59..5cd7199dea 100644 --- a/src/packages/frontend/projects/actions.ts +++ b/src/packages/frontend/projects/actions.ts @@ -347,6 +347,7 @@ export class ProjectsActions extends Actions { image?: string; // if given, sets the compute image (the ID string) start?: boolean; // immediately start on create noPool?: boolean; // never use the pool + license?: string; }): Promise { const image = await redux.getStore("customize").getDefaultComputeImage(); @@ -356,12 +357,14 @@ export class ProjectsActions extends Actions { image?: string; start: boolean; noPool?: boolean; + license?: string; } = defaults(opts, { title: "No Title", description: "No Description", image, start: false, noPool: undefined, + license: undefined, }); if (!opts2.image) { // make falseish same as not specified. diff --git a/src/packages/frontend/projects/create-project.tsx b/src/packages/frontend/projects/create-project.tsx index 9727e8b0ef..5659450d21 100644 --- a/src/packages/frontend/projects/create-project.tsx +++ b/src/packages/frontend/projects/create-project.tsx @@ -137,6 +137,7 @@ export const NewProjectCreator: React.FC = ({ title: title_text, image: await derive_project_img_name(custom_software), start: true, // used to not start, due to apply_default_upgrades, but upgrades are deprecated + license: license_id, }; try { project_id = await actions.create_project(opts); @@ -146,9 +147,6 @@ export const NewProjectCreator: React.FC = ({ set_error(`Error creating project -- ${err}`); return; } - if (isValidUUID(license_id)) { - await actions.add_site_license_to_project(project_id, license_id); - } track("create-project", { how: "projects-page", project_id,