diff --git a/api/chalicelib/core/metadata.py b/api/chalicelib/core/metadata.py index 2eb62a6b4..c245e44bf 100644 --- a/api/chalicelib/core/metadata.py +++ b/api/chalicelib/core/metadata.py @@ -83,7 +83,7 @@ def __edit(project_id, col_index, colname, new_name): return {"errors": ["custom field not found"]} with pg_client.PostgresClient() as cur: - if old_metas[col_index]["key"].lower() != new_name: + if old_metas[col_index]["key"] != new_name: cur.execute(cur.mogrify(f"""UPDATE public.projects SET {colname} = %(value)s WHERE project_id = %(project_id)s AND deleted_at ISNULL diff --git a/api/routers/core.py b/api/routers/core.py index 12ef38d98..df98c1c09 100644 --- a/api/routers/core.py +++ b/api/routers/core.py @@ -580,7 +580,7 @@ def add_metadata(projectId: int, data: schemas.MetadataBasicSchema = Body(...), @app.put('/{projectId}/metadata/{index}', tags=["metadata"]) def edit_metadata(projectId: int, index: int, data: schemas.MetadataBasicSchema = Body(...), context: schemas.CurrentContext = Depends(OR_context)): - return metadata.edit(tenant_id=context.tenant_id, project_id=projectId, index=int(index), + return metadata.edit(tenant_id=context.tenant_id, project_id=projectId, index=index, new_name=data.key)