File tree Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -408,7 +408,9 @@ def bulk_update_or_create_many_to_many(self):
408408 # Instead of failing bulk_create here below, we will add an error.
409409 self .errors .add_error (
410410 OscarOdinException (
411- {Through .__name__ : f"Cannot create m2m relationship { Through .__name__ } - related model '{ relation .related_model .__name__ } ' is missing a primary key" }
411+ {
412+ Through .__name__ : f"Cannot create m2m relationship { Through .__name__ } - related model '{ relation .related_model .__name__ } ' is missing a primary key"
413+ }
412414 ),
413415 instance ,
414416 )
Original file line number Diff line number Diff line change @@ -89,11 +89,11 @@ class ProductAttributeValueResource(OscarCatalogueResource):
8989
9090
9191class ParentProductResource (OscarCatalogueResource ):
92- upc : str
92+ upc : Optional [ str ]
9393
9494
9595class ProductRecommentationResource (OscarCatalogueResource ):
96- upc : str
96+ upc : Optional [ str ]
9797
9898
9999class ProductResource (OscarCatalogueResource ):
Original file line number Diff line number Diff line change @@ -677,7 +677,7 @@ def test_recommendation_non_existing(self):
677677 _ , errors = products_to_db (product_resource )
678678 self .assertEqual (len (errors ), 1 )
679679 self .assertEqual (
680- str (errors [0 ]),
680+ str (errors [0 ]. args [ 0 ][ "ProductRecommendation" ] ),
681681 "Cannot create m2m relationship ProductRecommendation - related model 'Product' is missing a primary key" ,
682682 )
683683
You can’t perform that action at this time.
0 commit comments