Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

feat: use id for webapp (#27576)

Xiyuan Chenf260627660e0
diff --git a/api/services/enterprise/enterprise_service.py b/api/services/enterprise/enterprise_service.py
index 974aa849db1..83d0fcf2969 100644
--- a/api/services/enterprise/enterprise_service.py
+++ b/api/services/enterprise/enterprise_service.py
@@ -92,16 +92,6 @@ class EnterpriseService:
return ret
- @classmethod
- def get_app_access_mode_by_code(cls, app_code: str) -> WebAppSettings:
- if not app_code:
- raise ValueError("app_code must be provided.")
- params = {"appCode": app_code}
- data = EnterpriseRequest.send_request("GET", "/webapp/access-mode/code", params=params)
- if not data:
- raise ValueError("No data found.")
- return WebAppSettings.model_validate(data)
-
@classmethod
def update_app_access_mode(cls, app_id: str, access_mode: str):
if not app_id:
diff --git a/api/tests/test_containers_integration_tests/services/test_webapp_auth_service.py b/api/tests/test_containers_integration_tests/services/test_webapp_auth_service.py
index 73e622b061f..72b119b4fff 100644
--- a/api/tests/test_containers_integration_tests/services/test_webapp_auth_service.py
+++ b/api/tests/test_containers_integration_tests/services/test_webapp_auth_service.py
@@ -35,9 +35,7 @@ class TestWebAppAuthService:
mock_enterprise_service.WebAppAuth.get_app_access_mode_by_id.return_value = type(
"MockWebAppAuth", (), {"access_mode": "private"}
)()
- mock_enterprise_service.WebAppAuth.get_app_access_mode_by_code.return_value = type(
- "MockWebAppAuth", (), {"access_mode": "private"}
- )()
+ # Note: get_app_access_mode_by_code method was removed in refactoring
yield {
"passport_service": mock_passport_service,