mirror of
https://github.com/apache/superset.git
synced 2026-04-20 00:24:38 +00:00
[config] Fixing GET_FEATURE_FLAGS_FUNC example (#9339)
* [config] Fixing GET_FEATURE_FLAGS_FUNC example * Adding typing for GET_FEATURE_FLAGS_FUNC * Update config.py
This commit is contained in:
@@ -301,10 +301,11 @@ FEATURE_FLAGS: Dict[str, bool] = {}
|
||||
# role-based features, or a full on A/B testing framework.
|
||||
#
|
||||
# from flask import g, request
|
||||
# def GET_FEATURE_FLAGS_FUNC(feature_flags_dict):
|
||||
# feature_flags_dict['some_feature'] = g.user and g.user.id == 5
|
||||
# def GET_FEATURE_FLAGS_FUNC(feature_flags_dict: Dict[str, bool]) -> Dict[str, bool]:
|
||||
# if hasattr(g, "user") and g.user.is_active:
|
||||
# feature_flags_dict['some_feature'] = g.user and g.user.id == 5
|
||||
# return feature_flags_dict
|
||||
GET_FEATURE_FLAGS_FUNC = None
|
||||
GET_FEATURE_FLAGS_FUNC: Optional[Callable[[Dict[str, bool]], Dict[str, bool]]] = None
|
||||
|
||||
|
||||
# ---------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user