Merge pull request #819 from SchrodingersGat/fix

Remove a test (for now) which is causing issues...
This commit is contained in:
Oliver 2020-05-19 17:56:56 +10:00 committed by GitHub
commit 51074ef02b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1112,11 +1112,13 @@ class StockItemTestResult(models.Model):
super().clean() super().clean()
"""
# If this test result corresponds to a template, check the requirements of the template # If this test result corresponds to a template, check the requirements of the template
key = helpers.generateTestKey(self.test) key = helpers.generateTestKey(self.test)
templates = self.stock_item.part.getTestTemplates() templates = self.stock_item.part.getTestTemplates()
TODO: Re-introduce this at a later stage, it is buggy when uplaoding an attachment via the API
for template in templates: for template in templates:
if key == template.key: if key == template.key:
@ -1126,16 +1128,14 @@ class StockItemTestResult(models.Model):
"value": _("Value must be provided for this test"), "value": _("Value must be provided for this test"),
}) })
"""
TODO: Re-introduce this at a later stage, it is buggy when uplaoding an attachment via the API
if template.requires_attachment: if template.requires_attachment:
if not self.attachment: if not self.attachment:
raise ValidationError({ raise ValidationError({
"attachment": _("Attachment must be uploaded for this test"), "attachment": _("Attachment must be uploaded for this test"),
}) })
"""
break break
"""
# If an attachment is linked to this result, the attachment must also point to the item # If an attachment is linked to this result, the attachment must also point to the item
try: try: