Properly pass template vars in case of posting error.

Since we no longer rely on locals(), error page template will be
rendered incompletely since no variables are passed to it.