Cleanup for Refactor-error-messages
This patch is a clean-up patch for refactor-error-messages bp which remove the exception message from base message otherwise the same exception message display twice like this https://ibb.co/XyFWMdz . Depends-On: https://review.opendev.org/#/c/708069/ Change-Id: I3ff5f7b25c0e91e67a8c98020993676d6345379e
This commit is contained in:
parent
a72fd198c9
commit
9e777ec9a4
@ -109,7 +109,7 @@ class DetailView(horizon.tables.MultiTableView):
|
|||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
LOG.exception(exc)
|
LOG.exception(exc)
|
||||||
actions = []
|
actions = []
|
||||||
msg = _('Action list can not be retrieved: %s') % str(exc)
|
msg = _('Action list can not be retrieved.')
|
||||||
horizon.exceptions.handle(self.request, msg)
|
horizon.exceptions.handle(self.request, msg)
|
||||||
return actions
|
return actions
|
||||||
|
|
||||||
|
@ -42,10 +42,10 @@ class IndexView(horizon.tables.DataTableView):
|
|||||||
search_opts = self.get_filters()
|
search_opts = self.get_filters()
|
||||||
try:
|
try:
|
||||||
actions = watcher.Action.list(self.request, **search_opts)
|
actions = watcher.Action.list(self.request, **search_opts)
|
||||||
except Exception as e:
|
except Exception:
|
||||||
horizon.exceptions.handle(
|
horizon.exceptions.handle(
|
||||||
self.request,
|
self.request,
|
||||||
_("Unable to retrieve action information: %s") % str(e))
|
_("Unable to retrieve action information."))
|
||||||
return actions
|
return actions
|
||||||
|
|
||||||
def get_actions_count(self):
|
def get_actions_count(self):
|
||||||
|
@ -131,7 +131,7 @@ class CreateForm(forms.SelfHandlingForm):
|
|||||||
messages.success(request, message)
|
messages.success(request, message)
|
||||||
return audit_tpl
|
return audit_tpl
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
msg = _('Failed to create audit template: %s') % str(exc)
|
msg = _('Failed to create audit template.')
|
||||||
LOG.info(exc)
|
LOG.info(exc)
|
||||||
redirect = reverse(self.failure_url)
|
redirect = reverse(self.failure_url)
|
||||||
exceptions.handle(request, msg, redirect=redirect)
|
exceptions.handle(request, msg, redirect=redirect)
|
||||||
|
@ -52,8 +52,7 @@ class IndexView(horizon.tables.DataTableView):
|
|||||||
LOG.exception(exc)
|
LOG.exception(exc)
|
||||||
horizon.exceptions.handle(
|
horizon.exceptions.handle(
|
||||||
self.request,
|
self.request,
|
||||||
_("Unable to retrieve audit template "
|
_("Unable to retrieve audit template information."))
|
||||||
"information: %s") % str(exc))
|
|
||||||
return audit_templates
|
return audit_templates
|
||||||
|
|
||||||
def get_count(self):
|
def get_count(self):
|
||||||
@ -118,7 +117,7 @@ class DetailView(horizon.tabs.TabbedTableView):
|
|||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
LOG.exception(exc)
|
LOG.exception(exc)
|
||||||
audits = []
|
audits = []
|
||||||
msg = _('Audits list cannot be retrieved: %s') % str(exc)
|
msg = _('Audits list cannot be retrieved.')
|
||||||
horizon.exceptions.handle(self.request, msg)
|
horizon.exceptions.handle(self.request, msg)
|
||||||
return audits
|
return audits
|
||||||
|
|
||||||
|
@ -56,10 +56,10 @@ class IndexView(horizon.tables.DataTableView):
|
|||||||
search_opts = self.get_filters()
|
search_opts = self.get_filters()
|
||||||
try:
|
try:
|
||||||
audits = watcher.Audit.list(self.request, **search_opts)
|
audits = watcher.Audit.list(self.request, **search_opts)
|
||||||
except Exception as e:
|
except Exception:
|
||||||
horizon.exceptions.handle(
|
horizon.exceptions.handle(
|
||||||
self.request,
|
self.request,
|
||||||
_("Unable to retrieve audit information: %s") % str(e))
|
_("Unable to retrieve audit information."))
|
||||||
return audits
|
return audits
|
||||||
|
|
||||||
def get_audits_count(self):
|
def get_audits_count(self):
|
||||||
@ -117,7 +117,7 @@ class DetailView(horizon.tables.MultiTableView):
|
|||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
LOG.exception(exc)
|
LOG.exception(exc)
|
||||||
audits = []
|
audits = []
|
||||||
msg = _('Action plan list cannot be retrieved: %s') % str(exc)
|
msg = _('Action plan list cannot be retrieved.')
|
||||||
horizon.exceptions.handle(self.request, msg)
|
horizon.exceptions.handle(self.request, msg)
|
||||||
return audits
|
return audits
|
||||||
|
|
||||||
|
@ -45,10 +45,10 @@ class IndexView(horizon.tables.DataTableView):
|
|||||||
search_opts = self.get_filters()
|
search_opts = self.get_filters()
|
||||||
try:
|
try:
|
||||||
goals = watcher.Goal.list(self.request, **search_opts)
|
goals = watcher.Goal.list(self.request, **search_opts)
|
||||||
except Exception as e:
|
except Exception:
|
||||||
horizon.exceptions.handle(
|
horizon.exceptions.handle(
|
||||||
self.request,
|
self.request,
|
||||||
_("Unable to retrieve goal information: %s") % str(e))
|
_("Unable to retrieve goal information."))
|
||||||
return goals
|
return goals
|
||||||
|
|
||||||
def get_goals_count(self):
|
def get_goals_count(self):
|
||||||
@ -97,7 +97,7 @@ class DetailView(horizon.tables.MultiTableView):
|
|||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
LOG.exception(exc)
|
LOG.exception(exc)
|
||||||
strategies = []
|
strategies = []
|
||||||
msg = _('Strategy list cannot be retrieved: %s') % str(exc)
|
msg = _('Strategy list cannot be retrieved.')
|
||||||
horizon.exceptions.handle(self.request, msg)
|
horizon.exceptions.handle(self.request, msg)
|
||||||
|
|
||||||
return strategies
|
return strategies
|
||||||
@ -110,8 +110,7 @@ class DetailView(horizon.tables.MultiTableView):
|
|||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
LOG.exception(exc)
|
LOG.exception(exc)
|
||||||
indicators_spec = []
|
indicators_spec = []
|
||||||
msg = _('Efficacy specification cannot be '
|
msg = _('Efficacy specification cannot be retrieved.')
|
||||||
'retrieved: %s') % str(exc)
|
|
||||||
horizon.exceptions.handle(self.request, msg)
|
horizon.exceptions.handle(self.request, msg)
|
||||||
|
|
||||||
return indicators_spec
|
return indicators_spec
|
||||||
|
@ -48,7 +48,7 @@ class IndexView(horizon.tables.DataTableView):
|
|||||||
LOG.exception(exc)
|
LOG.exception(exc)
|
||||||
horizon.exceptions.handle(
|
horizon.exceptions.handle(
|
||||||
self.request,
|
self.request,
|
||||||
_("Unable to retrieve strategy information: %s") % str(exc))
|
_("Unable to retrieve strategy information."))
|
||||||
return strategies
|
return strategies
|
||||||
|
|
||||||
def get_strategies_count(self):
|
def get_strategies_count(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user