Skip to content

Commit

Permalink
fix wrong implementation of creating project with license on the proj…
Browse files Browse the repository at this point in the history
…ects page

- you MUST pass the license in when creating the project, **NOT** add
  the license later.
  • Loading branch information
williamstein committed Jul 11, 2024
1 parent accd6d2 commit 72b6ecf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/packages/frontend/projects/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ export class ProjectsActions extends Actions<ProjectsState> {
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<string> {
const image = await redux.getStore("customize").getDefaultComputeImage();

Expand All @@ -356,12 +357,14 @@ export class ProjectsActions extends Actions<ProjectsState> {
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.
Expand Down
4 changes: 1 addition & 3 deletions src/packages/frontend/projects/create-project.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ export const NewProjectCreator: React.FC<Props> = ({
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);
Expand All @@ -146,9 +147,6 @@ export const NewProjectCreator: React.FC<Props> = ({
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,
Expand Down

0 comments on commit 72b6ecf

Please sign in to comment.