Browse Source

Merge pull request #4118 from jribbens/master

Fix convert_to_valid_json migrations
master
Voxin Muyli 1 year ago
parent
commit
d5d4e005c2
No account linked to committer's email address

+ 1
- 1
src/oscar/apps/basket/migrations/0010_convert_to_valid_json.py View File

@@ -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 View File

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

Loading…
Cancel
Save