focomy 0.1.108__py3-none-any.whl → 0.1.109__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- core/utils.py +7 -5
- {focomy-0.1.108.dist-info → focomy-0.1.109.dist-info}/METADATA +1 -1
- {focomy-0.1.108.dist-info → focomy-0.1.109.dist-info}/RECORD +6 -6
- {focomy-0.1.108.dist-info → focomy-0.1.109.dist-info}/WHEEL +0 -0
- {focomy-0.1.108.dist-info → focomy-0.1.109.dist-info}/entry_points.txt +0 -0
- {focomy-0.1.108.dist-info → focomy-0.1.109.dist-info}/licenses/LICENSE +0 -0
core/utils.py
CHANGED
|
@@ -48,7 +48,8 @@ def require_feature(feature: str) -> None:
|
|
|
48
48
|
async def is_feature_enabled_async(feature: str, db) -> bool:
|
|
49
49
|
"""Check if a feature is enabled (async version, DB-first).
|
|
50
50
|
|
|
51
|
-
Priority: DB settings >
|
|
51
|
+
Priority: DB settings > code default (True)
|
|
52
|
+
Note: config.yaml is ignored for features to allow DB override without restart.
|
|
52
53
|
|
|
53
54
|
Args:
|
|
54
55
|
feature: Feature name (e.g., 'form', 'comment')
|
|
@@ -57,10 +58,11 @@ async def is_feature_enabled_async(feature: str, db) -> bool:
|
|
|
57
58
|
Returns:
|
|
58
59
|
True if feature is enabled, False otherwise
|
|
59
60
|
"""
|
|
60
|
-
from .services.settings import SettingsService
|
|
61
|
+
from .services.settings import SettingsService, DEFAULT_SETTINGS
|
|
61
62
|
|
|
62
63
|
settings_svc = SettingsService(db)
|
|
63
|
-
|
|
64
|
+
# Check DB directly (not through get() which includes config.yaml)
|
|
65
|
+
db_value = await settings_svc._get_db_value(f"features.{feature}")
|
|
64
66
|
|
|
65
67
|
if db_value is not None:
|
|
66
68
|
# DB value exists, use it
|
|
@@ -70,8 +72,8 @@ async def is_feature_enabled_async(feature: str, db) -> bool:
|
|
|
70
72
|
return db_value.lower() in ("true", "1", "yes")
|
|
71
73
|
return bool(db_value)
|
|
72
74
|
|
|
73
|
-
# Fallback to config.yaml
|
|
74
|
-
return
|
|
75
|
+
# Fallback to code default (ignore config.yaml)
|
|
76
|
+
return DEFAULT_SETTINGS.get("features", {}).get(feature, True)
|
|
75
77
|
|
|
76
78
|
|
|
77
79
|
async def require_feature_async(feature: str, db) -> None:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: focomy
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.109
|
|
4
4
|
Summary: The Most Beautiful CMS - A metadata-driven, zero-duplicate-code content management system
|
|
5
5
|
Project-URL: Homepage, https://github.com/focomy/focomy
|
|
6
6
|
Project-URL: Documentation, https://focomy.dev/docs
|
|
@@ -5,7 +5,7 @@ core/database.py,sha256=wqvRuwpDxy25svag9NqreVcNA_VRDDjWsxOMUopsffs,2222
|
|
|
5
5
|
core/main.py,sha256=gc2s5La1qC6WCEq1Bc3UoUK1kKRzO7866-xSeYs_L4I,16647
|
|
6
6
|
core/rate_limit.py,sha256=CX5UjmsU03aFWKXSKjweoHvH2xn0v4NBHNN5ynJC8LE,180
|
|
7
7
|
core/relations.yaml,sha256=7GUCrphKaouEXNkyd8Ht99e6TcUPERhc4m36RGcc41U,2128
|
|
8
|
-
core/utils.py,sha256
|
|
8
|
+
core/utils.py,sha256=Rqs1WStB0JjTb8-750jL-xJ_kaPH3ddupvqt46BXIBc,2754
|
|
9
9
|
core/admin/__init__.py,sha256=IXrr-z-IDXmYodaZ-cVDou6wr_vsVhyWmXHdSNKkQsk,94
|
|
10
10
|
core/admin/routes.py,sha256=h9yl5THrlM74ZUPiiFoAlAVN-p3kMR1h-UH_xK1_T0k,147979
|
|
11
11
|
core/admin/url.py,sha256=FlusKnSz3bZgPSBmRu-dI3W-bQo7lKBDZ3zN8cFHwQc,2243
|
|
@@ -201,8 +201,8 @@ themes/minimal/templates/base.html,sha256=LFkx-XLDMGH7oFHHa0e6KPB0DJITOBvr6GtPkD
|
|
|
201
201
|
themes/minimal/templates/home.html,sha256=ygYQgYj1OGCiKwmfsxwkPselVKT8vDH3jLLbfphpqKI,1577
|
|
202
202
|
themes/minimal/templates/page.html,sha256=7Xcoq-ryaxlp913H2S1ishrAro2wsqqGmvsm1osXxd4,389
|
|
203
203
|
themes/minimal/templates/post.html,sha256=FkTRHci8HNIIi3DU6Mb3oL0aDisGyDcsT_IUDwHmrvo,1387
|
|
204
|
-
focomy-0.1.
|
|
205
|
-
focomy-0.1.
|
|
206
|
-
focomy-0.1.
|
|
207
|
-
focomy-0.1.
|
|
208
|
-
focomy-0.1.
|
|
204
|
+
focomy-0.1.109.dist-info/METADATA,sha256=KdDxlADdFCsXNDgMH4WcLM49cMPyVwmw-oKKVQGbziE,7042
|
|
205
|
+
focomy-0.1.109.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
206
|
+
focomy-0.1.109.dist-info/entry_points.txt,sha256=_rF-wxGI1axY7gox3DBsTLHq-JrFKkMCjA65a6b_oqE,41
|
|
207
|
+
focomy-0.1.109.dist-info/licenses/LICENSE,sha256=z9Z7gN7NNV7zYCaY-Knh3bv8RBCu89VueYtAlN_-lro,1063
|
|
208
|
+
focomy-0.1.109.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|