fix regression with genre and other_title change
This commit is contained in:
parent
c679aae640
commit
9174685359
2 changed files with 3 additions and 2 deletions
|
@ -237,8 +237,9 @@ class ArrayField(JSONFieldMixin, DJANGO_ArrayField):
|
|||
super().__init__(*args, **kwargs)
|
||||
|
||||
def from_json(self, value): # backward compatible with dirty legacy data
|
||||
if value or value == []:
|
||||
if value:
|
||||
return value if isinstance(value, list) else [value]
|
||||
return []
|
||||
|
||||
|
||||
class JSONField(JSONFieldMixin, DJANGO_JSONField):
|
||||
|
|
|
@ -12,7 +12,7 @@ class JSONFieldTestCase(TestCase):
|
|||
o.other_title = ["a", "b"]
|
||||
self.assertEqual(o.other_title, ["a", "b"])
|
||||
o.other_title = None
|
||||
self.assertEqual(o.other_title, None)
|
||||
self.assertEqual(o.other_title, [])
|
||||
|
||||
|
||||
class TMDBTVTestCase(TestCase):
|
||||
|
|
Loading…
Add table
Reference in a new issue