mirror of
https://github.com/meeb/tubesync.git
synced 2025-06-23 05:26:37 +00:00
Merge pull request #898 from tcely/patch-14
Some checks are pending
CI / info (push) Waiting to run
CI / test (3.10) (push) Waiting to run
CI / test (3.11) (push) Waiting to run
CI / test (3.12) (push) Waiting to run
CI / test (3.8) (push) Waiting to run
CI / test (3.9) (push) Waiting to run
CI / containerise (push) Blocked by required conditions
Some checks are pending
CI / info (push) Waiting to run
CI / test (3.10) (push) Waiting to run
CI / test (3.11) (push) Waiting to run
CI / test (3.12) (push) Waiting to run
CI / test (3.8) (push) Waiting to run
CI / test (3.9) (push) Waiting to run
CI / containerise (push) Blocked by required conditions
Handle strings better
This commit is contained in:
commit
4417f90271
@ -145,6 +145,9 @@ class CommaSepChoiceField(models.CharField):
|
|||||||
# The data was lost; we can regenerate it.
|
# The data was lost; we can regenerate it.
|
||||||
args_dict = {key: self.__dict__[key] for key in CommaSepChoice._fields}
|
args_dict = {key: self.__dict__[key] for key in CommaSepChoice._fields}
|
||||||
args_dict['selected_choices'] = list(value)
|
args_dict['selected_choices'] = list(value)
|
||||||
|
# setting a string manually should not result in characters
|
||||||
|
if isinstance(value, str) and len(value) > 0:
|
||||||
|
args_dict['selected_choices'] = value.split(self.separator)
|
||||||
data = CommaSepChoice(**args_dict)
|
data = CommaSepChoice(**args_dict)
|
||||||
value = data.selected_choices
|
value = data.selected_choices
|
||||||
s_value = super().get_prep_value(value)
|
s_value = super().get_prep_value(value)
|
||||||
|
Loading…
Reference in New Issue
Block a user