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

Method enable_v2_versioning

api/environments/models.py:203–214  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

201 # Environment.clone() method
202 @hook(BEFORE_SAVE, when="pk", is_now=None) # type: ignore[misc]
203 def enable_v2_versioning(self) -> None:
204 if self.use_v2_feature_versioning:
205 # if the environment has already been created with versioning enabled,
206 # we don't want to disable it based on the flag state.
207 return
208
209 organisation = self.project.organisation
210 self.use_v2_feature_versioning = get_openfeature_client().get_boolean_value(
211 "enable_feature_versioning_for_new_environments",
212 default_value=False,
213 evaluation_context=organisation.openfeature_evaluation_context,
214 )
215
216 def __str__(self): # type: ignore[no-untyped-def]
217 return "Project %s - Environment %s" % (self.project.name, self.name)

Callers

nothing calls this directly

Calls 1

get_openfeature_clientFunction · 0.90

Tested by

no test coverage detected