Skip to content

Commit 72b6ecf

Browse files
committed
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.
1 parent accd6d2 commit 72b6ecf

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/packages/frontend/projects/actions.ts

+3
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,7 @@ export class ProjectsActions extends Actions<ProjectsState> {
347347
image?: string; // if given, sets the compute image (the ID string)
348348
start?: boolean; // immediately start on create
349349
noPool?: boolean; // never use the pool
350+
license?: string;
350351
}): Promise<string> {
351352
const image = await redux.getStore("customize").getDefaultComputeImage();
352353

@@ -356,12 +357,14 @@ export class ProjectsActions extends Actions<ProjectsState> {
356357
image?: string;
357358
start: boolean;
358359
noPool?: boolean;
360+
license?: string;
359361
} = defaults(opts, {
360362
title: "No Title",
361363
description: "No Description",
362364
image,
363365
start: false,
364366
noPool: undefined,
367+
license: undefined,
365368
});
366369
if (!opts2.image) {
367370
// make falseish same as not specified.

src/packages/frontend/projects/create-project.tsx

+1-3
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ export const NewProjectCreator: React.FC<Props> = ({
137137
title: title_text,
138138
image: await derive_project_img_name(custom_software),
139139
start: true, // used to not start, due to apply_default_upgrades, but upgrades are deprecated
140+
license: license_id,
140141
};
141142
try {
142143
project_id = await actions.create_project(opts);
@@ -146,9 +147,6 @@ export const NewProjectCreator: React.FC<Props> = ({
146147
set_error(`Error creating project -- ${err}`);
147148
return;
148149
}
149-
if (isValidUUID(license_id)) {
150-
await actions.add_site_license_to_project(project_id, license_id);
151-
}
152150
track("create-project", {
153151
how: "projects-page",
154152
project_id,

0 commit comments

Comments
 (0)