Tax rule validation: Fix use of incorrect exception

This commit is contained in:
Raphael Michel
2018-03-26 10:15:12 +02:00
parent 95aaccb35e
commit 12b5e21314

View File

@@ -1,6 +1,7 @@
import json import json
from decimal import Decimal from decimal import Decimal
from django.core.exceptions import ValidationError
from django.db import models from django.db import models
from django.utils.formats import localize from django.utils.formats import localize
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
@@ -113,7 +114,7 @@ class TaxRule(LoggedModel):
def clean(self): def clean(self):
if self.eu_reverse_charge and not self.home_country: 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): def __str__(self):
if self.price_includes_tax: if self.price_includes_tax: