♻️ Move throwing redirect exception into method
[Sone.git] / src / main / kotlin / net / pterodactylus / sone / web / pages / OptionsPage.kt
index b9bc57c..2c454e8 100644 (file)
@@ -16,7 +16,7 @@ import javax.inject.*
 @TemplatePath("/templates/options.html")
 @ToadletPath("options.html")
 class OptionsPage @Inject constructor(webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer) :
-               SoneTemplatePage("options.html", webInterface, loaders, templateRenderer, pageTitleKey = "Page.Options.Title") {
+               SoneTemplatePage(webInterface, loaders, templateRenderer, pageTitleKey = "Page.Options.Title") {
 
        override fun handleRequest(soneRequest: SoneRequest, templateContext: TemplateContext) {
                if (soneRequest.isPOST) {
@@ -66,7 +66,7 @@ class OptionsPage @Inject constructor(webInterface: WebInterface, loaders: Loade
 
                        if (fieldsWithErrors.isEmpty()) {
                                soneRequest.core.touchConfiguration()
-                               throw RedirectException("options.html")
+                               redirectTo("options.html")
                        }
                        templateContext["fieldErrors"] = fieldsWithErrors
                }