From 31086a1fbfa4959e51e7d0a8aa2cbf5b0fab321f Mon Sep 17 00:00:00 2001 From: GareArc Date: Tue, 18 Mar 2025 03:53:07 -0400 Subject: [PATCH] feat: add webapp copyright feature --- api/services/feature_service.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/api/services/feature_service.py b/api/services/feature_service.py index 1deed47d75..368042cac9 100644 --- a/api/services/feature_service.py +++ b/api/services/feature_service.py @@ -55,6 +55,7 @@ class FeatureModel(BaseModel): can_replace_logo: bool = False model_load_balancing_enabled: bool = False dataset_operator_enabled: bool = False + webapp_copyright_enabled: bool = False # pydantic configs model_config = ConfigDict(protected_namespaces=()) @@ -86,6 +87,9 @@ class FeatureService: if dify_config.BILLING_ENABLED and tenant_id: cls._fulfill_params_from_billing_api(features, tenant_id) + if dify_config.ENTERPRISE_ENABLED: + features.webapp_copyright_enabled = True + return features @classmethod @@ -123,6 +127,9 @@ class FeatureService: features.billing.subscription.plan = billing_info["subscription"]["plan"] features.billing.subscription.interval = billing_info["subscription"]["interval"] + if features.billing.subscription.plan != "sandbox": + features.webapp_copyright_enabled = True + if "members" in billing_info: features.members.size = billing_info["members"]["size"] features.members.limit = billing_info["members"]["limit"]