2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-18 13:05:42 +00:00

Fix clean functions so unit tests pass

This commit is contained in:
Oliver Walters
2020-05-16 17:43:32 +10:00
parent 40735d66a1
commit a6ad263ee7
2 changed files with 23 additions and 12 deletions

View File

@ -60,11 +60,14 @@ class Build(MPTTModel):
super().clean()
if self.part.trackable:
if not self.quantity == int(self.quantity):
raise ValidationError({
'quantity': _("Build quantity must be integer value for trackable parts")
})
try:
if self.part.trackable:
if not self.quantity == int(self.quantity):
raise ValidationError({
'quantity': _("Build quantity must be integer value for trackable parts")
})
except PartModels.Part.DoesNotExist:
pass
title = models.CharField(
verbose_name=_('Build Title'),