if domain is true and return value of the function validate_host called with 2 arguments: domain and settings.ALLOWED_HOSTS, evaluates to true,
if domain and validate_host ( domain , settings . ALLOWED_HOSTS ) :