File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55from openfeature .provider .in_memory_provider import InMemoryFlag , InMemoryProvider
66
77
8+ class FeatureFlag :
9+ @staticmethod
10+ def is_enabled (name : str ) -> bool :
11+ return api .get_client ().get_boolean_value (name , False )
12+
13+
814def setup_feature_flags (flags_yaml_path : Path ) -> None :
915 """Initialise the OpenFeature InMemoryProvider from a YAML flags file.
1016
Original file line number Diff line number Diff line change 1- from openfeature import api
2-
1+ from manage_breast_screening .core .feature_flags import FeatureFlag
32from manage_breast_screening .gateway .models import Relay
43
54
65def gateway_images_enabled (appointment ):
76 """Check if automatic gateway image retrieval is enabled."""
8- feature_flags = api .get_client ()
9- if feature_flags .get_boolean_value ("gateway_images" , False ):
7+ if FeatureFlag .is_enabled ("gateway_images" ):
108 return Relay .for_appointment (appointment ) is not None
119 return False
You can’t perform that action at this time.
0 commit comments