浏览代码

Merge pull request #4118 from jribbens/master

Fix convert_to_valid_json migrations
master
Voxin Muyli 2 年前
父节点
当前提交
d5d4e005c2
没有帐户链接到提交者的电子邮件

+ 1
- 1
src/oscar/apps/basket/migrations/0010_convert_to_valid_json.py 查看文件

@@ -20,7 +20,7 @@ def forward(apps, schema_editor):
20 20
             at.value = json.dumps(val, cls=DjangoJSONEncoder)
21 21
             at.save()
22 22
             continue
23
-        except ValueError:
23
+        except (ValueError, SyntaxError):
24 24
             pass
25 25
 
26 26
         # convert the string to json as it is

+ 1
- 1
src/oscar/apps/order/migrations/0012_convert_to_valid_json.py 查看文件

@@ -20,7 +20,7 @@ def forward(apps, schema_editor):
20 20
             at.value = json.dumps(val, cls=DjangoJSONEncoder)
21 21
             at.save()
22 22
             continue
23
-        except ValueError:
23
+        except (ValueError, SyntaxError):
24 24
             pass
25 25
 
26 26
         # convert the string to json as it is

正在加载...
取消
保存