diff --git a/api/chalicelib/core/projects.py b/api/chalicelib/core/projects.py index 24d1e01f7..82103ce9c 100644 --- a/api/chalicelib/core/projects.py +++ b/api/chalicelib/core/projects.py @@ -54,6 +54,7 @@ def __create(tenant_id, name): def get_projects(tenant_id, recording_state=False, gdpr=None, recorded=False, stack_integrations=False): + stack_integrations = False with pg_client.PostgresClient() as cur: extra_projection = "" extra_join = "" diff --git a/api/routers/core.py b/api/routers/core.py index a23e437ea..58819a811 100644 --- a/api/routers/core.py +++ b/api/routers/core.py @@ -663,12 +663,6 @@ async def mobile_signe(projectId: int, sessionId: int, data: schemas.MobileSignP return {"data": mobile.sign_keys(project_id=projectId, session_id=sessionId, keys=data.keys)} -@public_app.post('/signup', tags=['signup']) -@public_app.put('/signup', tags=['signup']) -async def signup_handler(data: schemas.UserSignupSchema = Body(...)): - return signup.create_step1(data) - - @app.post('/projects', tags=['projects']) async def create_project(data: schemas.CreateProjectSchema = Body(...), context: schemas.CurrentContext = Depends(OR_context)): diff --git a/api/routers/core_dynamic.py b/api/routers/core_dynamic.py index c6f71e88f..f4d5e9a62 100644 --- a/api/routers/core_dynamic.py +++ b/api/routers/core_dynamic.py @@ -6,7 +6,7 @@ from starlette.responses import RedirectResponse, FileResponse import schemas from chalicelib.core import sessions, errors, errors_viewed, errors_favorite, sessions_assignments, heatmaps, \ - sessions_favorite, assist, sessions_notes, click_maps, sessions_replay + sessions_favorite, assist, sessions_notes, click_maps, sessions_replay, signup from chalicelib.core import sessions_viewed from chalicelib.core import tenants, users, projects, license from chalicelib.core import webhook @@ -27,6 +27,13 @@ async def get_all_signup(): "edition": license.EDITION}} +if not tenants.tenants_exists(use_pool=False): + @public_app.post('/signup', tags=['signup']) + @public_app.put('/signup', tags=['signup']) + async def signup_handler(data: schemas.UserSignupSchema = Body(...)): + return signup.create_step1(data) + + @app.get('/account', tags=['accounts']) async def get_account(context: schemas.CurrentContext = Depends(OR_context)): r = users.get(tenant_id=context.tenant_id, user_id=context.user_id) diff --git a/ee/api/chalicelib/core/projects.py b/ee/api/chalicelib/core/projects.py index dc06703ce..6b0628de7 100644 --- a/ee/api/chalicelib/core/projects.py +++ b/ee/api/chalicelib/core/projects.py @@ -55,6 +55,7 @@ def __create(tenant_id, name): def get_projects(tenant_id, recording_state=False, gdpr=None, recorded=False, stack_integrations=False, user_id=None): + stack_integrations = False with pg_client.PostgresClient() as cur: role_query = """INNER JOIN LATERAL (SELECT 1 FROM users diff --git a/ee/api/routers/core_dynamic.py b/ee/api/routers/core_dynamic.py index 209fdbd6d..34c517ee8 100644 --- a/ee/api/routers/core_dynamic.py +++ b/ee/api/routers/core_dynamic.py @@ -7,7 +7,7 @@ from starlette.responses import RedirectResponse, FileResponse import schemas import schemas_ee from chalicelib.core import sessions, assist, heatmaps, sessions_favorite, sessions_assignments, errors, errors_viewed, \ - errors_favorite, sessions_notes, click_maps, sessions_replay + errors_favorite, sessions_notes, click_maps, sessions_replay, signup from chalicelib.core import sessions_viewed from chalicelib.core import tenants, users, projects, license from chalicelib.core import webhook @@ -31,6 +31,13 @@ async def get_all_signup(): "edition": license.EDITION}} +if not tenants.tenants_exists(use_pool=False): + @public_app.post('/signup', tags=['signup']) + @public_app.put('/signup', tags=['signup']) + async def signup_handler(data: schemas.UserSignupSchema = Body(...)): + return signup.create_step1(data) + + @app.get('/account', tags=['accounts']) async def get_account(context: schemas.CurrentContext = Depends(OR_context)): r = users.get(tenant_id=context.tenant_id, user_id=context.user_id) diff --git a/ee/scripts/schema/db/init_dbs/postgresql/1.11.0/1.11.0.sql b/ee/scripts/schema/db/init_dbs/postgresql/1.11.0/1.11.0.sql index 21544f62c..a8b7a297b 100644 --- a/ee/scripts/schema/db/init_dbs/postgresql/1.11.0/1.11.0.sql +++ b/ee/scripts/schema/db/init_dbs/postgresql/1.11.0/1.11.0.sql @@ -22,10 +22,18 @@ $$ SELECT 'v1.11.0-ee' $$ LANGUAGE sql IMMUTABLE; +ALTER TYPE issue_type ADD VALUE IF NOT EXISTS 'mouse_thrashing'; + +LOCK TABLE ONLY events.inputs IN ACCESS EXCLUSIVE MODE; ALTER TABLE events.inputs ADD COLUMN duration integer NULL, ADD COLUMN hesitation integer NULL; +LOCK TABLE ONLY events.clicks IN ACCESS EXCLUSIVE MODE; +ALTER TABLE events.clicks + ADD COLUMN hesitation integer NULL; + +LOCK TABLE ONLY public.projects IN ACCESS EXCLUSIVE MODE; ALTER TABLE public.projects ALTER COLUMN gdpr SET DEFAULT '{ "maskEmails": true, @@ -34,9 +42,4 @@ ALTER TABLE public.projects "defaultInputMode": "obscured" }'::jsonb; -ALTER TYPE issue_type ADD VALUE IF NOT EXISTS 'mouse_thrashing'; - -ALTER TABLE events.clicks - ADD COLUMN hesitation integer NULL; - COMMIT; \ No newline at end of file diff --git a/scripts/schema/db/init_dbs/postgresql/1.11.0/1.11.0.sql b/scripts/schema/db/init_dbs/postgresql/1.11.0/1.11.0.sql index 0fde93c48..d0bfd18e2 100644 --- a/scripts/schema/db/init_dbs/postgresql/1.11.0/1.11.0.sql +++ b/scripts/schema/db/init_dbs/postgresql/1.11.0/1.11.0.sql @@ -22,10 +22,18 @@ $$ SELECT 'v1.11.0' $$ LANGUAGE sql IMMUTABLE; +ALTER TYPE issue_type ADD VALUE IF NOT EXISTS 'mouse_thrashing'; + +LOCK TABLE ONLY events.inputs IN ACCESS EXCLUSIVE MODE; ALTER TABLE events.inputs ADD COLUMN duration integer NULL, ADD COLUMN hesitation integer NULL; +LOCK TABLE ONLY events.clicks IN ACCESS EXCLUSIVE MODE; +ALTER TABLE events.clicks + ADD COLUMN hesitation integer NULL; + +LOCK TABLE ONLY public.projects IN ACCESS EXCLUSIVE MODE; ALTER TABLE public.projects ALTER COLUMN gdpr SET DEFAULT '{ "maskEmails": true, @@ -34,9 +42,4 @@ ALTER TABLE public.projects "defaultInputMode": "obscured" }'::jsonb; -ALTER TYPE issue_type ADD VALUE IF NOT EXISTS 'mouse_thrashing'; - -ALTER TABLE events.clicks - ADD COLUMN hesitation integer NULL; - COMMIT; \ No newline at end of file