Codebase list cloudkitty-dashboard / 554068b
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
4 changed file(s) with 14 addition(s) and 15 deletion(s). Raw diff Collapse all Expand all
7676 request,
7777 _('Service was successfully created'))
7878 return service
79 except Exception as ex:
79 except Exception:
8080 horizon_exceptions.handle(request,
81 _("Unable to create new service: %s")
82 % str(ex))
81 _("Unable to create new service."))
8382
8483 def __init__(self, request, *args, **kwargs):
8584 super(CreateServiceForm, self).__init__(request, *args, **kwargs)
108107 request,
109108 _('Field was successfully created'))
110109 return field
111 except Exception as ex:
110 except Exception:
112111 horizon_exceptions.handle(
113112 request,
114 _("Unable to create field: %s") % str(ex))
113 _("Unable to create field."))
115114
116115 def __init__(self, request, *args, **kwargs):
117116 super(CreateFieldForm, self).__init__(request, *args, **kwargs)
148147 request,
149148 _('Group was successfully created'))
150149 return group
151 except Exception as ex:
150 except Exception:
152151 horizon_exceptions.handle(
153152 request,
154 _("Unable to create group: %s") % str(ex))
153 _("Unable to create group."))
155154
156155
157156 class BaseForm(forms.SelfHandlingForm):
3131 request,
3232 _('Successfully updated priority'))
3333 return priority
34 except Exception as ex:
34 except Exception:
3535 exceptions.handle(request,
36 _("Unable to update priority: %s") % str(ex))
36 _("Unable to update priority."))
103103 request,
104104 _('Successfully created script'))
105105 return script
106 except Exception as ex:
106 except Exception:
107107 exceptions.handle(request,
108 _("Unable to create script: %s") % str(ex))
108 _("Unable to create script."))
109109
110110
111111 class EditScriptForm(CreateScriptForm):
130130 request,
131131 _('Successfully updated script'))
132132 return script
133 except Exception as ex:
133 except Exception:
134134 exceptions.handle(request,
135 _("Unable to update script: %s") % str(ex))
135 _("Unable to update script."))
6161 __update_quotation_data(json_data, service)
6262 pricing = float(api.cloudkittyclient(request)
6363 .rating.get_quotation(res_data=json_data))
64 except Exception as ex:
64 except Exception:
6565 exceptions.handle(request,
66 _('Unable to retrieve price: %s') % str(ex))
66 _('Unable to retrieve price.'))
6767
6868 return http.HttpResponse(json.dumps(pricing),
6969 content_type='application/json')