Skip to content

Commit

Permalink
Hable raw values with multi option
Browse files Browse the repository at this point in the history
  • Loading branch information
specialunderwear committed Oct 5, 2023
1 parent 84506b1 commit a74b8b0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/oscar/apps/catalogue/abstract_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1199,6 +1199,12 @@ def _set_value(self, new_value):
new_value = self.attribute.option_group.options.get(option=new_value)
elif self.attribute.is_multi_option:
getattr(self, attr_name).set(new_value)
multi_option = getattr(self, attr_name)
if any((isinstance(g, str) for g in new_value)):
multi_option.set(self.attribute.option_group.options.filter(option__in=new_value))

Check warning on line 1204 in src/oscar/apps/catalogue/abstract_models.py

View check run for this annotation

Codecov / codecov/patch

src/oscar/apps/catalogue/abstract_models.py#L1204

Added line #L1204 was not covered by tests
else:
multi_option.set(new_value)

self._dirty = True
return

Expand Down

0 comments on commit a74b8b0

Please sign in to comment.