Fixing the check for an object on the view

If "get_object" fails, the existing check_permissions method tries to grab the object off the view by calling getattr(), without first checking if that exists via hasattr(). Correcting this.