mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-30 20:46:47 +00:00
Perform unique checks for InvenTreeModelSerializer in DRF
- Prevents ValidationError from throwing in the wrong spot and not being handled
This commit is contained in:
parent
5198c5f9fa
commit
908039e1db
@ -50,6 +50,7 @@ class InvenTreeModelSerializer(serializers.ModelSerializer):
|
|||||||
|
|
||||||
# Now ensure the underlying model is correct
|
# Now ensure the underlying model is correct
|
||||||
instance = self.Meta.model(**data)
|
instance = self.Meta.model(**data)
|
||||||
|
instance.validate_unique()
|
||||||
instance.clean()
|
instance.clean()
|
||||||
|
|
||||||
return data
|
return data
|
||||||
|
Loading…
x
Reference in New Issue
Block a user