Merge "Fix bad parsing of HTTP response"

This commit is contained in:
Jenkins 2017-01-16 11:18:11 +00:00 committed by Gerrit Code Review
commit 024f584378
2 changed files with 3 additions and 3 deletions

View File

@ -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)

View File

@ -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)