X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FDeleteAlbumPage.kt;h=7830653d5dce601023a6aed5ac0e960ca0a58b59;hp=da7573251e4787b3ff77ce7f06ea5924df16591e;hb=9acbc5bdec4ccb752e0856a501568b0bb6161579;hpb=58418a5d13a1e8da185f1982f662c34eec2c4b1a diff --git a/src/main/kotlin/net/pterodactylus/sone/web/DeleteAlbumPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/DeleteAlbumPage.kt index da75732..7830653 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/DeleteAlbumPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/DeleteAlbumPage.kt @@ -1,9 +1,9 @@ package net.pterodactylus.sone.web +import net.pterodactylus.sone.utils.isPOST import net.pterodactylus.sone.web.page.FreenetRequest import net.pterodactylus.util.template.Template import net.pterodactylus.util.template.TemplateContext -import net.pterodactylus.util.web.Method.POST /** * Page that lets the user delete an {@link Album}. @@ -14,7 +14,7 @@ class DeleteAlbumPage(template: Template, webInterface: WebInterface): override fun handleRequest(request: FreenetRequest, templateContext: TemplateContext) { val album = webInterface.core.getAlbum(request.httpRequest.getPartAsStringFailsafe("album", 36)) templateContext["album"] = album ?: throw RedirectException("invalid.html") - if (request.method == POST) { + if (request.isPOST) { if (!album.sone.isLocal) { throw RedirectException("noPermission.html") }