While functional, the old code was a bit more verbose and repetitive. Each branch had its own logic for converting the response to an HttpResponse, which made it slightly harder to maintain if the conversion logic needed to be changed. With the make_response function, you centralize this logic in one place, making the code more readable and reusable. Additionally, if you want to change the response conversion behavior (e.g. add an HTTP header or other logic), you only need to do it in one place, making it easier to maintain in the long run.
While functional, the old code was a bit more verbose and repetitive. Each branch had its own logic for converting the response to an HttpResponse, which made it slightly harder to maintain if the conversion logic needed to be changed. With the make_response function, you centralize this logic in one place, making the code more readable and reusable. Additionally, if you want to change the response conversion behavior (e.g. add an HTTP header or other logic), you only need to do it in one place, making it easier to maintain in the long run.