X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FEditAlbumPage.kt;h=85ee17a1652056dc5d94f55a6fc7f53671673eeb;hb=ddc708d5b4cbebb3121fb000f44745f55b786e13;hp=8a59c33d7c0f6b67b7ead7ffea39b60e3ac013bf;hpb=3c2ae3673b11f5f0a4e0946c8ee8f5cbbe2d6a0a;p=Sone.git diff --git a/src/main/kotlin/net/pterodactylus/sone/web/EditAlbumPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/EditAlbumPage.kt index 8a59c33..85ee17a 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/EditAlbumPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/EditAlbumPage.kt @@ -1,10 +1,10 @@ package net.pterodactylus.sone.web import net.pterodactylus.sone.data.Album.Modifier.AlbumTitleMustNotBeEmpty +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 edit the name and description of an album. @@ -13,7 +13,7 @@ class EditAlbumPage(template: Template, webInterface: WebInterface): SoneTemplatePage("editAlbum.html", template, "Page.EditAlbum.Title", webInterface, true) { override fun handleRequest(request: FreenetRequest, templateContext: TemplateContext) { - if (request.method == POST) { + if (request.isPOST) { val album = webInterface.core.getAlbum(request.httpRequest.getPartAsStringFailsafe("album", 36)) ?: throw RedirectException("invalid.html") album.takeUnless { it.sone.isLocal }?.run { throw RedirectException("noPermission.html") } if (request.httpRequest.getPartAsStringFailsafe("moveLeft", 4) == "true") {