Updated contact/views.py with efficient code