Very minor documentation code fix.

Add the missing `if` in the generic views code example.