Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FormDetail view render_to_response lacks support for ajax GET requests #164

Closed
Doskious opened this issue Jun 17, 2015 · 0 comments
Closed

Comments

@Doskious
Copy link

The code responsible for returning a rendered response lacks support for properly returning GET requests originating via ajax. In django-forms-builder/forms_builder/forms/views.py, line 66 triggers on both GET and POST ajax, but lines 68 and 69 rely on the post() call to have set context["form_for_form"] already. Attempting to GET the form view via ajax presently results in a 500 server error, resulting from the KeyError created by the absence of a defined form_for_form property.

Note, the simple addition of and not self.request.method == "GET" to the if statement will solve this and cause only non-GET ajax requests to enter the conditional code while causing all GET requests to return uniform results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant