[cleanup] views.py: created a new function from the copy-pasted block of stuff
[cleanup] views.py: created a new function from the copy-pasted block of stuff

justinvh/gitpaste,justinvh/gitpaste,justinvh/gitpaste,justinvh/gitpaste