From 12b5e2131408df1bc9c2e5fcd4a73ce5b5a1c1dd Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Mon, 26 Mar 2018 10:15:12 +0200 Subject: [PATCH] Tax rule validation: Fix use of incorrect exception --- src/pretix/base/models/tax.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pretix/base/models/tax.py b/src/pretix/base/models/tax.py index c6f408f5b3..5827aee9af 100644 --- a/src/pretix/base/models/tax.py +++ b/src/pretix/base/models/tax.py @@ -1,6 +1,7 @@ import json from decimal import Decimal +from django.core.exceptions import ValidationError from django.db import models from django.utils.formats import localize from django.utils.translation import ugettext_lazy as _ @@ -113,7 +114,7 @@ class TaxRule(LoggedModel): def clean(self): if self.eu_reverse_charge and not self.home_country: - raise ValueError(_('You need to set your home country to use the reverse charge feature.')) + raise ValidationError(_('You need to set your home country to use the reverse charge feature.')) def __str__(self): if self.price_includes_tax: