fix: Cannot create new team on self-hosted (#3819)

This commit is contained in:
Tom Moor
2022-07-20 21:18:21 +01:00
committed by GitHub
parent 031a7d396f
commit ef0412c449
2 changed files with 20 additions and 1 deletions

View File

@@ -73,6 +73,23 @@ describe("teamCreator", () => {
});
describe("self hosted", () => {
it("should allow creating first team", async () => {
env.DEPLOYMENT = undefined;
const { team, isNewTeam } = await teamCreator({
name: "Test team",
subdomain: "example",
avatarUrl: "http://example.com/logo.png",
authenticationProvider: {
name: "google",
providerId: "example.com",
},
ip,
});
expect(isNewTeam).toBeTruthy();
expect(team.name).toEqual("Test team");
});
it("should not allow creating multiple teams in installation", async () => {
env.DEPLOYMENT = undefined;
await buildTeam();

View File

@@ -91,7 +91,9 @@ async function teamCreator({
}
}
throw MaximumTeamsError();
if (team) {
throw MaximumTeamsError();
}
}
// If the service did not provide a logo/avatar then we attempt to generate