Fix tracebacks coming from preview view due to emptry string parameter.

Fixes an issue where the admin preview view would throw a traceback when it received an empty string, which happened sometimes when hitting back on the snippet editing page.

In the future we should figure out how to keep the snippet preview iframe from adding to the browser's history, but for now this will stop the unnecessary tracebacks.

Also includes some small PEP8 fixes.