Skip to content

Commit

Permalink
Remove task_subsets from ProjectWriteSerializer (#8492)
Browse files Browse the repository at this point in the history
This is a generated field, so it makes no sense to write to it. In
practice, attempting to do so when creating a project causes a crash in
`ProjectWriteSerializer.create`, while doing it when updating a project
has no effect.
  • Loading branch information
SpecLad authored Oct 1, 2024
1 parent 0b7fc51 commit 99669f5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
5 changes: 5 additions & 0 deletions changelog.d/20241001_131450_roman.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
### Removed

- Removed the non-functional `task_subsets` parameter from the project create
and update endpoints
(<https://github.com/cvat-ai/cvat/pull/8492>)
3 changes: 1 addition & 2 deletions cvat/apps/engine/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1371,15 +1371,14 @@ class ProjectWriteSerializer(serializers.ModelSerializer):
labels = LabelSerializer(write_only=True, many=True, source='label_set', partial=True, default=[])
owner_id = serializers.IntegerField(write_only=True, allow_null=True, required=False)
assignee_id = serializers.IntegerField(write_only=True, allow_null=True, required=False)
task_subsets = serializers.ListField(write_only=True, child=serializers.CharField(), required=False)

target_storage = StorageSerializer(write_only=True, required=False)
source_storage = StorageSerializer(write_only=True, required=False)

class Meta:
model = models.Project
fields = ('name', 'labels', 'owner_id', 'assignee_id', 'bug_tracker',
'target_storage', 'source_storage', 'task_subsets',
'target_storage', 'source_storage',
)

def to_representation(self, instance):
Expand Down
12 changes: 0 additions & 12 deletions cvat/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9332,12 +9332,6 @@ components:
allOf:
- $ref: '#/components/schemas/StorageRequest'
writeOnly: true
task_subsets:
type: array
items:
type: string
minLength: 1
writeOnly: true
PatchedQualitySettingsRequest:
type: object
properties:
Expand Down Expand Up @@ -9658,12 +9652,6 @@ components:
allOf:
- $ref: '#/components/schemas/StorageRequest'
writeOnly: true
task_subsets:
type: array
items:
type: string
minLength: 1
writeOnly: true
required:
- name
ProviderTypeEnum:
Expand Down

0 comments on commit 99669f5

Please sign in to comment.