Skip to content

Commit

Permalink
Fix ProjectValueViewSet.copy_set action
Browse files Browse the repository at this point in the history
  • Loading branch information
jochenklar committed Jan 30, 2025
1 parent ab71cd9 commit e9099ff
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rdmo/projects/viewsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,8 @@ def copy_set(self, request, parent_lookup_project, pk=None):
})
set_value_serializer.is_valid(raise_exception=True)
set_value = set_value_serializer.save()

set_values = Value.objects.none()
set_values_list = set_empty_values_list = []

# add the new set value to response_values
Expand Down Expand Up @@ -616,7 +618,7 @@ def copy_set(self, request, parent_lookup_project, pk=None):
value.set_index, value.collection_index) in set_empty_values_list:
# update empty values
updated_value = set_values.get(attribute_id=value.attribute_id, set_prefix=value.set_prefix,
set_index=value.set_index, collection_index=value.collection_index)
set_index=value.set_index, collection_index=value.collection_index)
updated_value.text = value.text
updated_value.option = value.option
updated_value.external_id = value.external_id
Expand Down

0 comments on commit e9099ff

Please sign in to comment.