Changed functions within views.py