learning-unlimited/ESP-Website — pull request #190 by gkanwar (2011-11-29 05:01:21+00:00)
Title: Csrf fix + test

This should fix the cached csrf issues, etc. Overall the strategy is to loop through all of the forms and add an onsubmit call to check_csrf_cookie(). This works for non-AJAX forms. For AJAX forms, the ajax_tools handle_submit method needs to do the onsubmit stuff (because this function overrides the onsubmit for all AJAX forms). This was fixed in a previous commit.

Testing sets up controlled environments through the creation and modification of template overrides and then tests both AJAX and non-AJAX forms. All tests pass.