Cannot create a classification with a worker version using an ML class used by an existing manual classification

Erwan Rouchet
2023-02-01T15:04:14Z

1. Pick an ML class and an element. 2. Create a classification with that class and element without a worker version. 3. Create the same classification, but with a worker version. ```json { "non_field_errors": [ "A classifica...

1. Pick an ML class and an element.

2. Create a classification with that class and element without a worker version.

3. Create the same classification, but with a worker version.

{
    "non_field_errors": [
        "A classification of this worker version already exists for this element and this class."
    ]
}

Doing step 3 then 2 (creating with a worker version then without) will work without causing any error. The database constraints do allow the same ML class to be used twice in this way; it seems it is only an issue with the UniqueTogetherValidator in the serializers.