GUI-545: Use form.validate() to for CSRF check.  Minor PEP8 fixes