Merge "Fix KeyError in router:AddInterface error handle"
This commit is contained in:
commit
ab67012984
@ -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
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user