(self)
| 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) |
nothing calls this directly
no test coverage detected