-
Notifications
You must be signed in to change notification settings - Fork 470
Description
Symptom: loaddata raises DeserializationError for any organisation that has an environment with use_v2_feature_versioning = True.
Root cause: EnvironmentFeatureVersionManager (features/versioning/managers.py:16) inherits from SoftDeleteManager but is missing UUIDNaturalKeyManagerMixin. Every other exportable manager in the codebase includes this mixin. Without it, Django serialises FK references to EnvironmentFeatureVersion (on FeatureState.environment_feature_version and FeatureSegment.environment_feature_version) as a natural-key list ["<uuid>"], but the deserialiser cannot resolve the list back to an object because get_by_natural_key does not exist on the manager.
Fix: One-line change — add the mixin:
class EnvironmentFeatureVersionManager(UUIDNaturalKeyManagerMixin, SoftDeleteManager):This follows the exact pattern of FeatureManager, FeatureStateManager, FeatureSegmentManager, and SoftDeleteExportableManager.
Test: Use tests from #6765 to verify the correctness of the solution.