From: Magnus Hagander Date: Fri, 29 Jun 2018 11:29:25 +0000 (+0200) Subject: Fix incorrect exception names X-Git-Url: http://git.postgresql.org/gitweb/static/session/%7B%7Bsession.id%7D%7D-%7B%7Bsession.title%7Cslugify%7D%7D?a=commitdiff_plain;h=818424cfc3d3ba3b6dbfc2beedcfb6d7cffb2ebd;p=pgeu-website.git Fix incorrect exception names --- diff --git a/postgresqleu/cmutuel/management/commands/cmscrape.py b/postgresqleu/cmutuel/management/commands/cmscrape.py index 952ecaa..59878f6 100755 --- a/postgresqleu/cmutuel/management/commands/cmscrape.py +++ b/postgresqleu/cmutuel/management/commands/cmscrape.py @@ -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=';') diff --git a/postgresqleu/invoices/forms.py b/postgresqleu/invoices/forms.py index a40b91e..ed199cc 100644 --- a/postgresqleu/invoices/forms.py +++ b/postgresqleu/invoices/forms.py @@ -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 diff --git a/postgresqleu/mailqueue/management/commands/send_queued_mail.py b/postgresqleu/mailqueue/management/commands/send_queued_mail.py index 8185067..4268ab9 100755 --- a/postgresqleu/mailqueue/management/commands/send_queued_mail.py +++ b/postgresqleu/mailqueue/management/commands/send_queued_mail.py @@ -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.