I think a better way though would be to have `form_errors = []` at the top, and then each time here do `form_errors.append("...")`. And then do `messages.error(...)` in a loop at the bottom, and pass form_errors in to the template as well.

This communicates to the reader that you're keeping track of the errors for later (as opposed to calling messages.error like it does now which is communicating "display error then forget it ever existed").