🔧 chore(settings.py): change save_api_keys to remove_api_keys to improve semantics

The `save_api_keys` variable has been renamed to `remove_api_keys` to improve the semantics of the code. The new variable name better reflects the functionality of the code, which is to remove API keys from the projects saved in the database.
🔧 chore(__main__.py): change save_api_keys to remove_api_keys to improve semantics
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-06-15 19:29:29 -03:00
commit 2addbf2e0c
3 changed files with 9 additions and 10 deletions

View file

@ -1,6 +1,6 @@
from typing import List
from uuid import UUID
from langflow import settings
from langflow.settings import settings
from langflow.api.utils import remove_api_keys
from langflow.api.v1.schemas import FlowListCreate, FlowListRead
from langflow.database.models.flow import (
@ -61,7 +61,7 @@ def update_flow(
if not db_flow:
raise HTTPException(status_code=404, detail="Flow not found")
flow_data = flow.dict(exclude_unset=True)
if settings.save_api_keys:
if not settings.remove_api_keys:
flow_data = remove_api_keys(flow_data)
for key, value in flow_data.items():
setattr(db_flow, key, value)