dify/api/events/event_handlers/create_provider_when_tenant_updated.py
2023-05-15 08:51:32 +08:00

10 lines
274 B
Python

from events.tenant_event import tenant_was_created
from services.provider_service import ProviderService
@tenant_was_created.connect
def handle(sender, **kwargs):
tenant = sender
if tenant.status == 'normal':
ProviderService.create_system_provider(tenant)