fix regression with genre and other_title change

This commit is contained in:
Your Name 2023-04-17 23:18:53 -04:00 committed by Henri Dickson
parent c679aae640
commit 9174685359
2 changed files with 3 additions and 2 deletions

View file

@ -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):

View file

@ -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):