Skip to content

Commit

Permalink
Fix copy_set action
Browse files Browse the repository at this point in the history
  • Loading branch information
jochenklar committed Jan 10, 2025
1 parent 7d9e649 commit 3dfd383
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rdmo/projects/viewsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,14 +527,14 @@ def copy_set(self, request, parent_lookup_project, pk=None):

# create new values for the new set
values = []
set_prefix_length = len(set_value.set_prefix.split('|'))
set_prefix_length = len(set_value.set_prefix.split('|')) if set_value.set_prefix else 0
for value in currentValues:
value.id = None
if value.set_prefix == set_value.set_prefix:
value.set_index = set_value.set_index
else:
value.set_prefix = '|'.join([
str(set_value.set_index) if (index == set_prefix_length - 1) else value
str(set_value.set_index) if (index == set_prefix_length) else value
for index, value in enumerate(value.set_prefix.split('|'))
])
values.append(value)
Expand Down

0 comments on commit 3dfd383

Please sign in to comment.