Corrected error in views.py

Variable was called before it was asssigned.
Revert "Corrected error in views.py"

This reverts commit 04c501b850cb59bdf78cd7428a8631b59891a910.