I don't get this condition it. Comment told that if alias is not present in URL, then you use product name. So I expect that you check if params["alias"]:"" == "" and not vica versa.