PEP8 and PyFlakes fixes in the views.py file