Fix incorrect exception names
authorMagnus Hagander <magnus@hagander.net>
Fri, 29 Jun 2018 11:29:25 +0000 (13:29 +0200)
committerMagnus Hagander <magnus@hagander.net>
Fri, 29 Jun 2018 11:29:25 +0000 (13:29 +0200)
postgresqleu/cmutuel/management/commands/cmscrape.py
postgresqleu/invoices/forms.py
postgresqleu/mailqueue/management/commands/send_queued_mail.py

index 952ecaa5b027398f63a1b9d0a91e162d3c7edf84..59878f6ebc5d3264af2bb5c64a1c92742133e3f3 100755 (executable)
@@ -161,7 +161,7 @@ class Command(BaseCommand):
                        'data_formats_options_csv_show':'True',
                })
                if c.getinfo(pycurl.RESPONSE_CODE) != 200:
-                       raise CommandException("Supposed to receive 200, got %s" % c.getinfo(c.RESPONSE_CODE))
+                       raise CommandError("Supposed to receive 200, got %s" % c.getinfo(c.RESPONSE_CODE))
 
                reader = csv.reader(s.getvalue().splitlines(), delimiter=';')
 
index a40b91ee1954fea5e98db3cdc064e6e116337c6a..ed199cca8a953473773f5af9e4c187ded8f1b446 100644 (file)
@@ -115,7 +115,7 @@ class RefundForm(forms.Form):
                try:
                        amount = Decimal(self.cleaned_data['amount'])
                        if amount < 1 or amount > self.invoice.total_amount-self.invoice.total_vat:
-                               raise ValidatonError(errstr)
+                               raise ValidationError(errstr)
                        if amount.as_tuple().exponent > 0 or amount.as_tuple().exponent < -2:
                                raise ValidationError("Maximum two decimal digits supported")
                        return self.cleaned_data['amount']
@@ -130,8 +130,9 @@ class RefundForm(forms.Form):
                try:
                        amount = Decimal(self.cleaned_data['vatamount'])
                        if amount < 1 or amount > self.invoice.total_vat:
-                               raise ValidatonError(errstr)
-                       if amount.as_tuple().exponent > 0 or amount.as_tuple().exponent < -2:                           raise ValidationError("Maximum two decimal digits supported")
+                               raise ValidationError(errstr)
+                       if amount.as_tuple().exponent > 0 or amount.as_tuple().exponent < -2:
+                               raise ValidationError("Maximum two decimal digits supported")
                        return self.cleaned_data['vatamount']
                except ValidationError:
                        raise
index 8185067985ea61ffc303b856fa24fb610da1e63b..4268ab9ba5499dc9d3c19345e2e4512b54702817 100755 (executable)
@@ -22,7 +22,7 @@ class Command(BaseCommand):
                curs = connection.cursor()
                curs.execute("SELECT pg_try_advisory_lock(72181378)")
                if not curs.fetchall()[0][0]:
-                       raise CommandException("Failed to get advisory lock, existing send_queued_mail process stuck?")
+                       raise CommandError("Failed to get advisory lock, existing send_queued_mail process stuck?")
 
                for m in QueuedMail.objects.all():
                        # Yes, we do a new connection for each run. Just because we can.