If i do it other the other way, i would need the instantiation of the HttpResponse in 2 else clauses. To avoid the extra code. I changed it and set response to None. i check befor the return if response is set. If not, I will set it to HttpResponse