Refactor public_view_url check to be more pythonic

In addition to this I also removed the is_public variable because the new utils
function says the same thing so it is redundant.
Merge pull request #19 from t3hh00d/refactor-middleware

Refactor public_view_url check to be more pythonic