mirror of
https://github.com/langgenius/dify.git
synced 2026-04-28 11:56:55 +08:00
refactor: replace db.session with session in DatasourceProviderService for consistency
This commit is contained in:
parent
543f80ad5d
commit
cf4a526e7f
@ -135,7 +135,7 @@ class DatasourceProviderService:
|
|||||||
datasource_provider=datasource_provider,
|
datasource_provider=datasource_provider,
|
||||||
)
|
)
|
||||||
datasource_provider.expires_at = refreshed_credentials.expires_at
|
datasource_provider.expires_at = refreshed_credentials.expires_at
|
||||||
db.session.commit()
|
session.commit()
|
||||||
|
|
||||||
return self.decrypt_datasource_provider_credentials(
|
return self.decrypt_datasource_provider_credentials(
|
||||||
tenant_id=tenant_id,
|
tenant_id=tenant_id,
|
||||||
@ -580,8 +580,8 @@ class DatasourceProviderService:
|
|||||||
auth_type=CredentialType.API_KEY.value,
|
auth_type=CredentialType.API_KEY.value,
|
||||||
encrypted_credentials=credentials,
|
encrypted_credentials=credentials,
|
||||||
)
|
)
|
||||||
db.session.add(datasource_provider)
|
session.add(datasource_provider)
|
||||||
db.session.commit()
|
session.commit()
|
||||||
|
|
||||||
def extract_secret_variables(self, tenant_id: str, provider_id: str, credential_type: CredentialType) -> list[str]:
|
def extract_secret_variables(self, tenant_id: str, provider_id: str, credential_type: CredentialType) -> list[str]:
|
||||||
"""
|
"""
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user