mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-20 12:39:14 +08:00
fix(plugin_service): Add marketplace enabled check before plugin operations (#18806)
This commit is contained in:
parent
db7af52fcc
commit
f6305858a5
@ -190,6 +190,9 @@ class PluginService:
|
|||||||
"""
|
"""
|
||||||
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")
|
||||||
|
|
||||||
@ -316,6 +319,9 @@ class PluginService:
|
|||||||
"""
|
"""
|
||||||
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)
|
||||||
@ -333,6 +339,9 @@ class PluginService:
|
|||||||
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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user