mirror of
https://github.com/langgenius/dify.git
synced 2026-04-05 16:50:39 +08:00
refactor: use EnumText for credential_type in TriggerSubscription (#34174)
Co-authored-by: Asuka Minato <i@asukaminato.eu.org> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
@@ -275,7 +275,7 @@ class BuiltinToolManageService:
|
||||
user_id=user_id,
|
||||
provider=provider,
|
||||
encrypted_credentials=json.dumps(encrypter.encrypt(credentials)),
|
||||
credential_type=api_type.value,
|
||||
credential_type=api_type,
|
||||
name=name,
|
||||
expires_at=expires_at if expires_at is not None else -1,
|
||||
)
|
||||
@@ -314,7 +314,7 @@ class BuiltinToolManageService:
|
||||
.filter_by(
|
||||
tenant_id=tenant_id,
|
||||
provider=provider,
|
||||
credential_type=credential_type.value,
|
||||
credential_type=credential_type,
|
||||
)
|
||||
.order_by(BuiltinToolProvider.created_at.desc())
|
||||
.all()
|
||||
|
||||
@@ -423,7 +423,7 @@ class ToolTransformService:
|
||||
id=provider.id,
|
||||
name=provider.name,
|
||||
provider=provider.provider,
|
||||
credential_type=CredentialType.of(provider.credential_type),
|
||||
credential_type=provider.credential_type,
|
||||
is_default=provider.is_default,
|
||||
credentials=credentials,
|
||||
)
|
||||
|
||||
@@ -198,7 +198,7 @@ class TriggerProviderService:
|
||||
credentials=dict(credential_encrypter.encrypt(dict(credentials)))
|
||||
if credential_encrypter
|
||||
else {},
|
||||
credential_type=credential_type.value,
|
||||
credential_type=credential_type,
|
||||
credential_expires_at=credential_expires_at,
|
||||
expires_at=expires_at,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user