Explorar el Código

fix(plugin_service): Add marketplace enabled check before plugin operations (#18806)

tags/1.3.1
Yeuoly hace 6 meses
padre
commit
f6305858a5
No account linked to committer's email address
Se han modificado 1 ficheros con 9 adiciones y 0 borrados
  1. 9
    0
      api/services/plugin/plugin_service.py

+ 9
- 0
api/services/plugin/plugin_service.py Ver fichero

""" """
Upgrade plugin with marketplace Upgrade plugin with marketplace
""" """
if not dify_config.MARKETPLACE_ENABLED:
raise ValueError("marketplace is not enabled")

if original_plugin_unique_identifier == new_plugin_unique_identifier: if original_plugin_unique_identifier == new_plugin_unique_identifier:
raise ValueError("you should not upgrade plugin with the same plugin") raise ValueError("you should not upgrade plugin with the same plugin")


""" """
Fetch marketplace package Fetch marketplace package
""" """
if not dify_config.MARKETPLACE_ENABLED:
raise ValueError("marketplace is not enabled")

manager = PluginInstallationManager() manager = PluginInstallationManager()
try: try:
declaration = manager.fetch_plugin_manifest(tenant_id, plugin_unique_identifier) declaration = manager.fetch_plugin_manifest(tenant_id, plugin_unique_identifier)
Install plugin from marketplace package files, Install plugin from marketplace package files,
returns installation task id returns installation task id
""" """
if not dify_config.MARKETPLACE_ENABLED:
raise ValueError("marketplace is not enabled")

manager = PluginInstallationManager() manager = PluginInstallationManager()


# check if already downloaded # check if already downloaded

Cargando…
Cancelar
Guardar