X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fpages%2FDeleteReplyPage.kt;h=e6fbce88d411853cd9c6f6772ed13cb6ca9b4d20;hp=e3f30ce1d9ed4d0bb02c3ce03c70ed8c530d5b24;hb=aaf780d3c2a6f5ce47295786f3963c8b93f6a145;hpb=16cdb3cc357d30441ddcb13c8841f9928fdb0adb diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/DeleteReplyPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/DeleteReplyPage.kt index e3f30ce..e6fbce8 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/DeleteReplyPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/DeleteReplyPage.kt @@ -19,17 +19,17 @@ class DeleteReplyPage @Inject constructor(webInterface: WebInterface, loaders: L override fun handleRequest(soneRequest: SoneRequest, currentSone: Sone, templateContext: TemplateContext) { if (soneRequest.isPOST) { val replyId = soneRequest.httpRequest.getPartAsStringFailsafe("reply", 36) - val reply = soneRequest.core.getPostReply(replyId) ?: throw RedirectException("noPermission.html") + val reply = soneRequest.core.getPostReply(replyId) ?: redirectTo("noPermission.html") if (!reply.sone.isLocal) { - throw RedirectException("noPermission.html") + redirectTo("noPermission.html") } val returnPage = soneRequest.httpRequest.getPartAsStringFailsafe("returnPage", 256) if (soneRequest.httpRequest.isPartSet("confirmDelete")) { soneRequest.core.deleteReply(reply) - throw RedirectException(returnPage) + redirectTo(returnPage) } if (soneRequest.httpRequest.isPartSet("abortDelete")) { - throw RedirectException(returnPage) + redirectTo(returnPage) } templateContext["reply"] = replyId templateContext["returnPage"] = returnPage