Browse Source

fix: license str parser. (#11248)

Garfield Dai 4 months ago
parent
commit
dbc10e0feb
1 changed files with 6 additions and 4 deletions
  1. 6 4
      api/services/feature_service.py

+ 6 - 4
api/services/feature_service.py

@@ -171,8 +171,10 @@ class FeatureService:
             features.is_allow_create_workspace = enterprise_info["is_allow_create_workspace"]
             features.is_allow_create_workspace = enterprise_info["is_allow_create_workspace"]
 
 
         if "license" in enterprise_info:
         if "license" in enterprise_info:
-            if "status" in enterprise_info["license"]:
-                features.license.status = enterprise_info["license"]["status"]
+            license_info = enterprise_info["license"]
 
 
-            if "expired_at" in enterprise_info["license"]:
-                features.license.expired_at = enterprise_info["license"]["expired_at"]
+            if "status" in license_info:
+                features.license.status = LicenseStatus(license_info.get("status", LicenseStatus.INACTIVE))
+
+            if "expired_at" in license_info:
+                features.license.expired_at = license_info["expired_at"]