Skip to content

Commit 554068b

Browse files
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
1 parent 79b287b commit 554068b

File tree

4 files changed

+14
-15
lines changed

4 files changed

+14
-15
lines changed

cloudkittydashboard/dashboards/admin/hashmap/forms.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,9 @@ def handle(self, request, data):
7777
request,
7878
_('Service was successfully created'))
7979
return service
80-
except Exception as ex:
80+
except Exception:
8181
horizon_exceptions.handle(request,
82-
_("Unable to create new service: %s")
83-
% str(ex))
82+
_("Unable to create new service."))
8483

8584
def __init__(self, request, *args, **kwargs):
8685
super(CreateServiceForm, self).__init__(request, *args, **kwargs)
@@ -109,10 +108,10 @@ def handle(self, request, data):
109108
request,
110109
_('Field was successfully created'))
111110
return field
112-
except Exception as ex:
111+
except Exception:
113112
horizon_exceptions.handle(
114113
request,
115-
_("Unable to create field: %s") % str(ex))
114+
_("Unable to create field."))
116115

117116
def __init__(self, request, *args, **kwargs):
118117
super(CreateFieldForm, self).__init__(request, *args, **kwargs)
@@ -149,10 +148,10 @@ def handle(self, request, data):
149148
request,
150149
_('Group was successfully created'))
151150
return group
152-
except Exception as ex:
151+
except Exception:
153152
horizon_exceptions.handle(
154153
request,
155-
_("Unable to create group: %s") % str(ex))
154+
_("Unable to create group."))
156155

157156

158157
class BaseForm(forms.SelfHandlingForm):

cloudkittydashboard/dashboards/admin/modules/forms.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ def handle(self, request, data):
3232
request,
3333
_('Successfully updated priority'))
3434
return priority
35-
except Exception as ex:
35+
except Exception:
3636
exceptions.handle(request,
37-
_("Unable to update priority: %s") % str(ex))
37+
_("Unable to update priority."))

cloudkittydashboard/dashboards/admin/pyscripts/forms.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ def handle(self, request, data):
104104
request,
105105
_('Successfully created script'))
106106
return script
107-
except Exception as ex:
107+
except Exception:
108108
exceptions.handle(request,
109-
_("Unable to create script: %s") % str(ex))
109+
_("Unable to create script."))
110110

111111

112112
class EditScriptForm(CreateScriptForm):
@@ -131,6 +131,6 @@ def handle(self, request, data):
131131
request,
132132
_('Successfully updated script'))
133133
return script
134-
except Exception as ex:
134+
except Exception:
135135
exceptions.handle(request,
136-
_("Unable to update script: %s") % str(ex))
136+
_("Unable to update script."))

cloudkittydashboard/dashboards/project/rating/views.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ def __update_quotation_data(element, service):
6262
__update_quotation_data(json_data, service)
6363
pricing = float(api.cloudkittyclient(request)
6464
.rating.get_quotation(res_data=json_data))
65-
except Exception as ex:
65+
except Exception:
6666
exceptions.handle(request,
67-
_('Unable to retrieve price: %s') % str(ex))
67+
_('Unable to retrieve price.'))
6868

6969
return http.HttpResponse(json.dumps(pricing),
7070
content_type='application/json')

0 commit comments

Comments
 (0)