Pass the action dynamic form data to the class as a standard form_class

argument.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2017-08-26 02:00:22 -04:00
parent 718a49437a
commit 7fdd816a1a
4 changed files with 13 additions and 50 deletions

View File

@@ -54,17 +54,10 @@ class HTTPPostAction(WorkflowAction):
}
}
def __init__(self, url=None, payload=None):
self.url = url
self.payload = payload
def get_form_schema(self, request):
return {
'fields': self.fields,
'widgets': self.widgets
}
def execute(self, context):
self.url = self.form_data.get('url')
self.payload = self.form_data.get('payload')
try:
url = Template(self.url).render(
context=Context(context)