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

Change-Id: I999c8fd4db3b8245f90e3e8f517af606c3b68aa7
This commit is contained in:
manchandavishal 2020-08-26 12:39:53 +00:00
parent 79b287ba53
commit 554068bb0e
4 changed files with 14 additions and 15 deletions

View File

@ -77,10 +77,9 @@ class CreateServiceForm(forms.SelfHandlingForm):
request,
_('Service was successfully created'))
return service
except Exception as ex:
except Exception:
horizon_exceptions.handle(request,
_("Unable to create new service: %s")
% str(ex))
_("Unable to create new service."))
def __init__(self, request, *args, **kwargs):
super(CreateServiceForm, self).__init__(request, *args, **kwargs)
@ -109,10 +108,10 @@ class CreateFieldForm(forms.SelfHandlingForm):
request,
_('Field was successfully created'))
return field
except Exception as ex:
except Exception:
horizon_exceptions.handle(
request,
_("Unable to create field: %s") % str(ex))
_("Unable to create field."))
def __init__(self, request, *args, **kwargs):
super(CreateFieldForm, self).__init__(request, *args, **kwargs)
@ -149,10 +148,10 @@ class CreateGroupForm(forms.SelfHandlingForm):
request,
_('Group was successfully created'))
return group
except Exception as ex:
except Exception:
horizon_exceptions.handle(
request,
_("Unable to create group: %s") % str(ex))
_("Unable to create group."))
class BaseForm(forms.SelfHandlingForm):

View File

@ -32,6 +32,6 @@ class EditPriorityForm(forms.SelfHandlingForm):
request,
_('Successfully updated priority'))
return priority
except Exception as ex:
except Exception:
exceptions.handle(request,
_("Unable to update priority: %s") % str(ex))
_("Unable to update priority."))

View File

@ -104,9 +104,9 @@ class CreateScriptForm(forms.SelfHandlingForm):
request,
_('Successfully created script'))
return script
except Exception as ex:
except Exception:
exceptions.handle(request,
_("Unable to create script: %s") % str(ex))
_("Unable to create script."))
class EditScriptForm(CreateScriptForm):
@ -131,6 +131,6 @@ class EditScriptForm(CreateScriptForm):
request,
_('Successfully updated script'))
return script
except Exception as ex:
except Exception:
exceptions.handle(request,
_("Unable to update script: %s") % str(ex))
_("Unable to update script."))

View File

@ -62,9 +62,9 @@ def quote(request):
__update_quotation_data(json_data, service)
pricing = float(api.cloudkittyclient(request)
.rating.get_quotation(res_data=json_data))
except Exception as ex:
except Exception:
exceptions.handle(request,
_('Unable to retrieve price: %s') % str(ex))
_('Unable to retrieve price.'))
return http.HttpResponse(json.dumps(pricing),
content_type='application/json')