From 023f5487c50c02ba8cd4e0f38d7d383abfa921f8 Mon Sep 17 00:00:00 2001 From: David TARDIVEL Date: Mon, 16 Jan 2017 12:03:23 +0100 Subject: [PATCH] Fix bad parsing of HTTP response Fix bad parsing of HTTP response, on exception. Change-Id: I7457ab3e1321dcc9511a090e982e53af48f0a0e7 Closes-Bug: #1642865 --- watcher_dashboard/content/audit_templates/forms.py | 2 +- watcher_dashboard/content/audits/forms.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/watcher_dashboard/content/audit_templates/forms.py b/watcher_dashboard/content/audit_templates/forms.py index 084a241..7d5368c 100644 --- a/watcher_dashboard/content/audit_templates/forms.py +++ b/watcher_dashboard/content/audit_templates/forms.py @@ -131,7 +131,7 @@ class CreateForm(forms.SelfHandlingForm): messages.success(request, message) return audit_tpl except Exception as exc: - msg = _('Failed to create audit template"%s".') % data['name'] + msg = _('Failed to create audit template.') LOG.info(exc) redirect = reverse(self.failure_url) exceptions.handle(request, msg, redirect=redirect) diff --git a/watcher_dashboard/content/audits/forms.py b/watcher_dashboard/content/audits/forms.py index 12c2a61..b3fd1fb 100644 --- a/watcher_dashboard/content/audits/forms.py +++ b/watcher_dashboard/content/audits/forms.py @@ -97,10 +97,10 @@ class CreateForm(forms.SelfHandlingForm): messages.success(request, message) return audit except Exception as exc: - if exc.status_code == 409: + if exc.http_status == 409: msg = _('Quota exceeded for resource audit.') else: - msg = _('Failed to create audit "%s".') % data['name'] + msg = _('Failed to create audit.') LOG.info(exc) redirect = reverse(self.failure_url) exceptions.handle(request, msg, redirect=redirect)