2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-09-18 16:41:32 +00:00

Perform model validation on API serializers

If you have a class, why not subclass it?!
This commit is contained in:
Oliver Walters
2019-06-13 23:03:58 +10:00
parent 222c9f1876
commit ff6df9741f
4 changed files with 18 additions and 14 deletions

View File

@@ -142,6 +142,8 @@ class StockItem(models.Model):
- Quantity must be 1 if the StockItem has a serial number
"""
print("Trying to clean the StockItem")
# The 'supplier_part' field must point to the same part!
try:
if self.supplier_part is not None: