2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-11 07:24:15 +00:00

Fix validation for Build model (#6038)

* Fix validation for Build model

- Move checks into clean() method
- Allows errors to be handled cleanly when editing from the admin interface

* Fix unit test
This commit is contained in:
Oliver
2023-12-06 09:48:49 +11:00
committed by GitHub
parent f70a049102
commit 2aef05c1c3
2 changed files with 12 additions and 7 deletions

View File

@ -491,7 +491,7 @@ class BuildTest(BuildTestBase):
# Should not be able to change the part after the Build is saved
with self.assertRaises(ValidationError):
bo.part = assembly_2
bo.save()
bo.clean()
def test_cancel(self):
"""Test cancellation of the build"""