The only allowed values for `view_on_site` are a boolean or a callable thus you can safely use the `self.view_on_site` conditional here.