mirror of
https://github.com/langgenius/dify.git
synced 2026-04-27 14:08:18 +08:00
[autofix.ci] apply automated fixes
This commit is contained in:
@ -204,7 +204,7 @@ class ScheduleService:
|
||||
return ScheduleConfig(node_id=node_id, cron_expression=cron_expression, timezone=timezone)
|
||||
|
||||
@staticmethod
|
||||
def extract_schedule_config(workflow: Workflow) -> Optional[ScheduleConfig]:
|
||||
def extract_schedule_config(workflow: Workflow) -> ScheduleConfig | None:
|
||||
"""
|
||||
Extracts schedule configuration from workflow graph.
|
||||
|
||||
|
||||
@ -117,7 +117,7 @@ class TriggerProviderService:
|
||||
parameters: Mapping[str, Any],
|
||||
properties: Mapping[str, Any],
|
||||
credentials: Mapping[str, str],
|
||||
subscription_id: Optional[str] = None,
|
||||
subscription_id: str | None = None,
|
||||
credential_expires_at: int = -1,
|
||||
expires_at: int = -1,
|
||||
) -> Mapping[str, Any]:
|
||||
@ -435,7 +435,7 @@ class TriggerProviderService:
|
||||
return {"result": "success", "expires_at": int(refreshed.expires_at)}
|
||||
|
||||
@classmethod
|
||||
def get_oauth_client(cls, tenant_id: str, provider_id: TriggerProviderID) -> Optional[Mapping[str, Any]]:
|
||||
def get_oauth_client(cls, tenant_id: str, provider_id: TriggerProviderID) -> Mapping[str, Any] | None:
|
||||
"""
|
||||
Get OAuth client configuration for a provider.
|
||||
First tries tenant-level OAuth, then falls back to system OAuth.
|
||||
@ -509,8 +509,8 @@ class TriggerProviderService:
|
||||
cls,
|
||||
tenant_id: str,
|
||||
provider_id: TriggerProviderID,
|
||||
client_params: Optional[Mapping[str, Any]] = None,
|
||||
enabled: Optional[bool] = None,
|
||||
client_params: Mapping[str, Any] | None = None,
|
||||
enabled: bool | None = None,
|
||||
) -> Mapping[str, Any]:
|
||||
"""
|
||||
Save or update custom OAuth client parameters for a trigger provider.
|
||||
|
||||
@ -67,7 +67,7 @@ class WebhookService:
|
||||
with Session(db.engine) as session:
|
||||
# Get webhook trigger
|
||||
webhook_trigger = (
|
||||
session.query(WorkflowWebhookTrigger).filter(WorkflowWebhookTrigger.webhook_id == webhook_id).first()
|
||||
session.query(WorkflowWebhookTrigger).where(WorkflowWebhookTrigger.webhook_id == webhook_id).first()
|
||||
)
|
||||
if not webhook_trigger:
|
||||
raise ValueError(f"Webhook not found: {webhook_id}")
|
||||
|
||||
Reference in New Issue
Block a user