Unverified Commit 784da52e authored by takatost's avatar takatost Committed by GitHub

fix: credentials validate compatible problem (#2170)

parent 78524a56
...@@ -153,8 +153,16 @@ class ProviderConfiguration(BaseModel): ...@@ -153,8 +153,16 @@ class ProviderConfiguration(BaseModel):
if provider_record: if provider_record:
try: try:
original_credentials = json.loads( # fix origin data
provider_record.encrypted_config) if provider_record.encrypted_config else {} if provider_record.encrypted_config:
if not provider_record.encrypted_config.startswith("{"):
original_credentials = {
"openai_api_key": provider_record.encrypted_config
}
else:
original_credentials = json.loads(provider_record.encrypted_config)
else:
original_credentials = {}
except JSONDecodeError: except JSONDecodeError:
original_credentials = {} original_credentials = {}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment