@@ -42,7 +42,7 @@ def template_name(self):
4242 if self .action in ("create" , "retrieve" ):
4343 template = "detail"
4444 else :
45- template = self .action
45+ template = self .task_action_paths . get ( self . action , self . action )
4646 return "data_wizard/run_{}.html" .format (template )
4747
4848 def get_renderers (self ):
@@ -112,6 +112,7 @@ def run_and_retrieve(self, request, task_name):
112112 return response
113113
114114 task_actions_ready = False
115+ task_action_paths = {}
115116
116117 @classmethod
117118 def get_extra_actions (cls ):
@@ -139,15 +140,19 @@ def task_action(self, request, *args, **kwargs):
139140 methods = ["POST" ]
140141 else :
141142 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
143145 task_action = action (
144146 detail = True ,
145147 methods = methods ,
146148 url_path = meta ["url_path" ],
147149 url_name = meta ["url_path" ],
148150 )(task_action )
149151
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+ )
151156
152157 @action (detail = True )
153158 def records (self , request , * args , ** kwargs ):
0 commit comments