Browse Source

Merge "Remove redundant exception handling"

tags/9.0.0.0b1^0
Zuul 1 week ago
parent
commit
ee3680a4d6

+ 1
- 9
mistraldashboard/action_executions/tables.py View File

@@ -17,7 +17,6 @@ from django.urls import reverse
17 17
 from django.utils.translation import ugettext_lazy as _
18 18
 from django.utils.translation import ungettext_lazy
19 19
 
20
-from horizon import exceptions
21 20
 from horizon import tables
22 21
 
23 22
 from mistraldashboard import api
@@ -31,14 +30,7 @@ class UpdateRow(tables.Row):
31 30
     ajax = True
32 31
 
33 32
     def get_data(self, request, id):
34
-        try:
35
-            instance = api.action_execution_get(request, id)
36
-        except Exception as e:
37
-            msg = _("Unable to get action execution by ID %(id)s: %(e)s.") % {
38
-                'id': id, 'e': str(e)
39
-            }
40
-            exceptions.handle(request, msg)
41
-
33
+        instance = api.action_execution_get(request, id)
42 34
         return instance
43 35
 
44 36
 

+ 7
- 21
mistraldashboard/action_executions/views.py View File

@@ -18,7 +18,6 @@ from django.urls import reverse_lazy
18 18
 from django.utils.translation import ugettext_lazy as _
19 19
 from django.views import generic
20 20
 
21
-from horizon import exceptions
22 21
 from horizon import forms
23 22
 from horizon import tables
24 23
 
@@ -30,17 +29,11 @@ from mistraldashboard import forms as mistral_forms
30 29
 
31 30
 
32 31
 def get_single_action_execution_data(request, **kwargs):
33
-    try:
34
-        action_execution_id = kwargs['action_execution_id']
35
-        action_execution = api.action_execution_get(
36
-            request,
37
-            action_execution_id
38
-        )
39
-    except Exception:
40
-        msg = _('Unable to get action execution "%s".') % action_execution_id
41
-        redirect = reverse('horizon:mistral:action_executions:index')
42
-        exceptions.handle(request, msg, redirect=redirect)
43
-
32
+    action_execution_id = kwargs['action_execution_id']
33
+    action_execution = api.action_execution_get(
34
+        request,
35
+        action_execution_id
36
+    )
44 37
     return action_execution
45 38
 
46 39
 
@@ -161,14 +154,7 @@ class FilteredByTaskView(tables.DataTableView):
161 154
     data = {}
162 155
 
163 156
     def get_data(self, **kwargs):
164
-        try:
165
-            task_id = self.kwargs['task_id']
166
-            data = api.action_executions_list(self.request, task_id)
167
-        except Exception:
168
-            msg = (
169
-                _('Unable to get action execution by task id "%s".') % task_id
170
-            )
171
-            redirect = reverse('horizon:mistral:action_executions:index')
172
-            exceptions.handle(self.request, msg, redirect=redirect)
157
+        task_id = self.kwargs['task_id']
158
+        data = api.action_executions_list(self.request, task_id)
173 159
 
174 160
         return data

Loading…
Cancel
Save