From ac4fb637f8434e179d8193a2c8389910e4482408 Mon Sep 17 00:00:00 2001 From: Taha Yassine Kraiem Date: Fri, 28 Oct 2022 17:51:55 +0200 Subject: [PATCH] feat(chalice): changed create projects method --- api/chalicelib/core/sourcemaps.py | 13 +++++-------- api/routers/core.py | 2 +- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/api/chalicelib/core/sourcemaps.py b/api/chalicelib/core/sourcemaps.py index 035ce1ca2..147304a4e 100644 --- a/api/chalicelib/core/sourcemaps.py +++ b/api/chalicelib/core/sourcemaps.py @@ -148,14 +148,11 @@ MAX_COLUMN_OFFSET = 60 def fetch_missed_contexts(frames): source_cache = {} for i in range(len(frames)): - try: - if len(frames[i]["context"]) > 0: - continue - except Exception: - print(">>>>>>>> fetch_missed_contexts exception:") - print(frames) - print("------------------") - raise + print(">>>>>>>> fetch_missed_contexts exception:") + print(frames[i]) + print("------------------") + if len(frames[i]["context"]) > 0: + continue file_abs_path = frames[i]["frame"]["absPath"] if file_abs_path in source_cache: file = source_cache[file_abs_path] diff --git a/api/routers/core.py b/api/routers/core.py index 7d4492f38..2a0777421 100644 --- a/api/routers/core.py +++ b/api/routers/core.py @@ -771,7 +771,7 @@ def signup_handler(data: schemas.UserSignupSchema = Body(...)): return signup.create_step1(data) -@app.put('/projects', tags=['projects']) +@app.post('/projects', tags=['projects']) def create_project(data: schemas.CreateProjectSchema = Body(...), context: schemas.CurrentContext = Depends(OR_context)): return projects.create(tenant_id=context.tenant_id, user_id=context.user_id, data=data)