Merge "Fix KeyError in router:AddInterface error handle"

This commit is contained in:
Jenkins 2014-04-20 20:18:45 +00:00 committed by Gerrit Code Review
commit ab67012984

View File

@ -56,8 +56,12 @@ class AddInterface(forms.SelfHandlingForm):
msg = _('Failed to get network list %s') % e.message msg = _('Failed to get network list %s') % e.message
LOG.info(msg) LOG.info(msg)
messages.error(request, msg) messages.error(request, msg)
redirect = reverse(self.failure_url, router_id = request.REQUEST.get('router_id',
args=[request.REQUEST['router_id']]) self.initial.get('router_id'))
if router_id:
redirect = reverse(self.failure_url, args=[router_id])
else:
redirect = reverse('horizon:project:routers:index')
exceptions.handle(request, msg, redirect=redirect) exceptions.handle(request, msg, redirect=redirect)
return return