Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions lfs/manage/product/variants.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,15 +377,12 @@ def add_property_option(request, product_id):
"""
property_option_form = PropertyOptionForm(data=request.POST)
if property_option_form.is_valid():
names = request.POST.get("name").split(",")
name = request.POST.get("name")
position = 999
property_id = request.POST.get("property_id")
for name in names:
property_option = PropertyOption(name=name)
property_option.property_id = property_id
property_option.position = position
property_option.save()
position += 1
property_option = PropertyOption(name=name)
property_option.property_id = request.POST.get("property_id")
property_option.position = position
property_option.save()

# Refresh positions
for i, option in enumerate(PropertyOption.objects.filter(property=property_id)):
Expand Down