This method is pasted from django (and slightly modified) and, in my opinion, at least this if statement it's much more readable than the new one.