Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def execute_action_form(request, agent, action, xhr=None):
- if request.method == "POST":
- inputs = get_action_inputs(agent, action)
- logger.debug("Recreating form")
- form_type = create_action_form(inputs)
- form = form_type(request.POST)
- #TODO: Verify if we can remove this workaround
- #Added to fix bugs during first creation of form (in debug mode there is no problem)
- try:
- form.is_valid()
- except Exception, e:
- logger.debug(e)
- #End Bug workaround
- #Check if the <xhr> var had something passed to it.
- if xhr == "xhr":
- # Yup, this is an Ajax request.
- # Validate the form:
- clean = form.is_valid()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement