Update views.py

add except ValueError