X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fpages%2FDistrustPage.kt;h=dd3ad8c476237c9a30c7db8f7462d500f91c7172;hb=aaf780d3c2a6f5ce47295786f3963c8b93f6a145;hp=6a4fa8f7df34c043fce785ca5e8b978be4281f60;hpb=2e6be6f2fb6afede009dacc48b8e3318e30e5057;p=Sone.git diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/DistrustPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/DistrustPage.kt index 6a4fa8f..dd3ad8c 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/DistrustPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/DistrustPage.kt @@ -14,14 +14,15 @@ import javax.inject.* * * @see net.pterodactylus.sone.core.Core#distrustSone(Sone, Sone) */ +@ToadletPath("distrust.html") class DistrustPage @Inject constructor(webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer) : - LoggedInPage("distrust.html", "Page.Distrust.Title", webInterface, loaders, templateRenderer) { + LoggedInPage("Page.Distrust.Title", webInterface, loaders, templateRenderer) { override fun handleRequest(soneRequest: SoneRequest, currentSone: Sone, templateContext: TemplateContext) { if (soneRequest.isPOST) { soneRequest.core.getSone(soneRequest.httpRequest.getPartAsStringFailsafe("sone", 44)) ?.run { soneRequest.core.distrustSone(currentSone, this) } - throw RedirectException(soneRequest.httpRequest.getPartAsStringFailsafe("returnPage", 256)) + redirectTo(soneRequest.httpRequest.getPartAsStringFailsafe("returnPage", 256)) } }