Skip to content
Snippets Groups Projects
Commit 4af12ac8 authored by pengyuesheng's avatar pengyuesheng
Browse files

Remove the function of messages.error in AddRouterRoute

The function of exceptions.handle can throw an error message,
no need messages.error

Change-Id: I9cd07a314a13ec3118d031d29d88b0d926389c52
parent f9374ffb
No related branches found
No related tags found
No related merge requests found
......@@ -48,12 +48,10 @@ class AddRouterRoute(forms.SelfHandlingForm):
LOG.info('Invalid format for routes %(route)s: %(exc)s',
{'route': route, 'exc': e})
msg = _('Invalid format for routes: %s') % e
messages.error(request, msg)
redirect = reverse(self.failure_url, args=[router_id])
exceptions.handle(request, msg, redirect=redirect)
except Exception as e:
LOG.info('Failed to add route: %s', e)
msg = _('Failed to add route: %s') % e
messages.error(request, msg)
redirect = reverse(self.failure_url, args=[router_id])
exceptions.handle(request, msg, redirect=redirect)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment