syntax fixes in views.py