WIP: pep8 and pylint cleanup

I'm surprised this doesn't cause 500 errors when Django invokes this method.