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
manchandavishal
3 years ago
76 | 76 |
request,
|
77 | 77 |
_('Service was successfully created'))
|
78 | 78 |
return service
|
79 | |
except Exception as ex:
|
|
79 |
except Exception:
|
80 | 80 |
horizon_exceptions.handle(request,
|
81 | |
_("Unable to create new service: %s")
|
82 | |
% str(ex))
|
|
81 |
_("Unable to create new service."))
|
83 | 82 |
|
84 | 83 |
def __init__(self, request, *args, **kwargs):
|
85 | 84 |
super(CreateServiceForm, self).__init__(request, *args, **kwargs)
|
|
108 | 107 |
request,
|
109 | 108 |
_('Field was successfully created'))
|
110 | 109 |
return field
|
111 | |
except Exception as ex:
|
|
110 |
except Exception:
|
112 | 111 |
horizon_exceptions.handle(
|
113 | 112 |
request,
|
114 | |
_("Unable to create field: %s") % str(ex))
|
|
113 |
_("Unable to create field."))
|
115 | 114 |
|
116 | 115 |
def __init__(self, request, *args, **kwargs):
|
117 | 116 |
super(CreateFieldForm, self).__init__(request, *args, **kwargs)
|
|
148 | 147 |
request,
|
149 | 148 |
_('Group was successfully created'))
|
150 | 149 |
return group
|
151 | |
except Exception as ex:
|
|
150 |
except Exception:
|
152 | 151 |
horizon_exceptions.handle(
|
153 | 152 |
request,
|
154 | |
_("Unable to create group: %s") % str(ex))
|
|
153 |
_("Unable to create group."))
|
155 | 154 |
|
156 | 155 |
|
157 | 156 |
class BaseForm(forms.SelfHandlingForm):
|
31 | 31 |
request,
|
32 | 32 |
_('Successfully updated priority'))
|
33 | 33 |
return priority
|
34 | |
except Exception as ex:
|
|
34 |
except Exception:
|
35 | 35 |
exceptions.handle(request,
|
36 | |
_("Unable to update priority: %s") % str(ex))
|
|
36 |
_("Unable to update priority."))
|
103 | 103 |
request,
|
104 | 104 |
_('Successfully created script'))
|
105 | 105 |
return script
|
106 | |
except Exception as ex:
|
|
106 |
except Exception:
|
107 | 107 |
exceptions.handle(request,
|
108 | |
_("Unable to create script: %s") % str(ex))
|
|
108 |
_("Unable to create script."))
|
109 | 109 |
|
110 | 110 |
|
111 | 111 |
class EditScriptForm(CreateScriptForm):
|
|
130 | 130 |
request,
|
131 | 131 |
_('Successfully updated script'))
|
132 | 132 |
return script
|
133 | |
except Exception as ex:
|
|
133 |
except Exception:
|
134 | 134 |
exceptions.handle(request,
|
135 | |
_("Unable to update script: %s") % str(ex))
|
|
135 |
_("Unable to update script."))
|
61 | 61 |
__update_quotation_data(json_data, service)
|
62 | 62 |
pricing = float(api.cloudkittyclient(request)
|
63 | 63 |
.rating.get_quotation(res_data=json_data))
|
64 | |
except Exception as ex:
|
|
64 |
except Exception:
|
65 | 65 |
exceptions.handle(request,
|
66 | |
_('Unable to retrieve price: %s') % str(ex))
|
|
66 |
_('Unable to retrieve price.'))
|
67 | 67 |
|
68 | 68 |
return http.HttpResponse(json.dumps(pricing),
|
69 | 69 |
content_type='application/json')
|