X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FDeleteProfileFieldPage.kt;h=c957bd7e61a535ce3226926d9d4a05f84bf60f0d;hp=b053eabb16905288e3c3449c02486f70063bf0fb;hb=9acbc5bdec4ccb752e0856a501568b0bb6161579;hpb=8e1bc4537886c3ca59d9b026b8ecb6e750385d31 diff --git a/src/main/kotlin/net/pterodactylus/sone/web/DeleteProfileFieldPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/DeleteProfileFieldPage.kt index b053eab..c957bd7 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/DeleteProfileFieldPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/DeleteProfileFieldPage.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 confirm the deletion of a profile field. @@ -15,7 +15,7 @@ class DeleteProfileFieldPage(template: Template, webInterface: WebInterface): val currentSone = getCurrentSone(request.toadletContext) val field = currentSone.profile.getFieldById(request.httpRequest.getPartAsStringFailsafe("field", 36)) ?: throw RedirectException("invalid.html") templateContext["field"] = field - if (request.method == POST) { + if (request.isPOST) { if (request.httpRequest.getPartAsStringFailsafe("confirm", 4) == "true") { currentSone.profile = currentSone.profile.apply { removeField(field) } }