Commit 052cee88 by Őry Máté

dashboard: support extra Operation args in OperationView

parent 3f7f0833
...@@ -442,7 +442,7 @@ class OperationView(DetailView): ...@@ -442,7 +442,7 @@ class OperationView(DetailView):
return self._opobj return self._opobj
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
ctx = super(OperationView, self).get_context_data(form=None, **kwargs) ctx = super(OperationView, self).get_context_data(**kwargs)
ctx['op'] = self.get_op() ctx['op'] = self.get_op()
ctx['url'] = self.request.path ctx['url'] = self.request.path
return ctx return ctx
...@@ -455,10 +455,12 @@ class OperationView(DetailView): ...@@ -455,10 +455,12 @@ class OperationView(DetailView):
{'body': response.content}) {'body': response.content})
return response return response
def post(self, request, *args, **kwargs): def post(self, request, extra=None, *args, **kwargs):
self.object = self.get_object() self.object = self.get_object()
if extra is None:
extra = {}
try: try:
self.get_op().async(user=request.user) self.get_op().async(user=request.user, **extra)
except Exception as e: except Exception as e:
messages.error(request, _('Could not start operation.')) messages.error(request, _('Could not start operation.'))
logger.error(e) logger.error(e)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment