Merge pull request #346 from SimoRubi/patch-1

[FIX] quality_control: Constraint methods should raise ValidationError
This commit is contained in:
Lois Rilo
2019-04-11 13:15:50 +02:00
committed by GitHub

View File

@@ -33,7 +33,7 @@ class QcTestTemplateCategory(models.Model):
('parent_id', '!=', False)])
ids = list(set([x.parent_id.id for x in parents]))
if not level:
raise exceptions.UserError(
raise exceptions.ValidationError(
_('Error! You can not create recursive categories.'))
level -= 1