Each of these if-clauses is pretty independent. They seem better suited to being separate functions, or even separate views with their own distinct urls. Especially since I don't think it's actually possible to have a single request with multiple actions in it.