MCPcopy Create free account
hub / github.com/Flagsmith/flagsmith / get_feature_state_value_defaults

Method get_feature_state_value_defaults

api/features/models.py:746–761  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

744 return self.get_feature_state_value_by_hash_key(identity_hash_key) # type: ignore[arg-type]
745
746 def get_feature_state_value_defaults(self) -> dict[str, typing.Any]:
747 if (
748 self.feature.initial_value is None
749 or self.feature.project.prevent_flag_defaults
750 ):
751 return {}
752
753 value = self.feature.initial_value
754 type_ = get_value_type(value)
755 parse_func = {
756 BOOLEAN: get_boolean_from_string,
757 INTEGER: get_integer_from_string,
758 }.get(type_, lambda v: v)
759 key_name = self.get_feature_state_key_name(type_)
760
761 return {"type": type_, key_name: parse_func(value)}
762
763 def get_multivariate_feature_state_value(
764 self, identity_hash_key: str

Callers 1

Calls 3

get_value_typeFunction · 0.90
getMethod · 0.45

Tested by

no test coverage detected