@@ -42,7 +42,7 @@ def template_name(self):
42
42
if self .action in ("create" , "retrieve" ):
43
43
template = "detail"
44
44
else :
45
- template = self .action
45
+ template = self .task_action_paths . get ( self . action , self . action )
46
46
return "data_wizard/run_{}.html" .format (template )
47
47
48
48
def get_renderers (self ):
@@ -112,6 +112,7 @@ def run_and_retrieve(self, request, task_name):
112
112
return response
113
113
114
114
task_actions_ready = False
115
+ task_action_paths = {}
115
116
116
117
@classmethod
117
118
def get_extra_actions (cls ):
@@ -139,15 +140,19 @@ def task_action(self, request, *args, **kwargs):
139
140
methods = ["POST" ]
140
141
else :
141
142
methods = ["GET" ]
142
- task_action .__name__ = task_name .split ("." )[- 1 ]
143
+ task_action_name = task_name .split ("." )[- 1 ]
144
+ task_action .__name__ = task_action_name
143
145
task_action = action (
144
146
detail = True ,
145
147
methods = methods ,
146
148
url_path = meta ["url_path" ],
147
149
url_name = meta ["url_path" ],
148
150
)(task_action )
149
151
150
- setattr (cls , task_action .__name__ , task_action )
152
+ setattr (cls , task_action_name , task_action )
153
+ cls .task_action_paths [task_action_name ] = (
154
+ meta ["url_path" ] or task_action_name
155
+ )
151
156
152
157
@action (detail = True )
153
158
def records (self , request , * args , ** kwargs ):
0 commit comments