From da022230e20fcc8e133f059ab9ffdc60eb50d202 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 29 Nov 2017 22:11:01 +0100 Subject: [PATCH] Actually store the profile back in the Sone --- src/main/kotlin/net/pterodactylus/sone/web/pages/EditProfilePage.kt | 1 + src/test/kotlin/net/pterodactylus/sone/web/pages/EditProfilePageTest.kt | 1 + 2 files changed, 2 insertions(+) diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/EditProfilePage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/EditProfilePage.kt index 1166208..95c40c8 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/EditProfilePage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/EditProfilePage.kt @@ -37,6 +37,7 @@ class EditProfilePage(template: Template, webInterface: WebInterface) : profile.fields.forEach { field -> field.value = TextFilter.filter(freenetRequest.httpRequest.getHeader("Host"), freenetRequest.httpRequest.getPartAsStringFailsafe("field-${field.id}", 400).trim()) } + currentSone.profile = profile webInterface.core.touchConfiguration() throw RedirectException("editProfile.html") } else if (freenetRequest.httpRequest.getPartAsStringFailsafe("add-field", 4) == "true") { diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/EditProfilePageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/EditProfilePageTest.kt index f76786a..b4e6570 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/EditProfilePageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/EditProfilePageTest.kt @@ -86,6 +86,7 @@ class EditProfilePageTest: WebPageTest(::EditProfilePage) { addHttpRequestPart("save-profile", "true") addHttpRequestPart(fieldName, newValue.toString()) verifyRedirect("editProfile.html") { + verify(currentSone).profile = profile verify(core).touchConfiguration() assertThat(fieldAccessor(), equalTo(expectedValue)) } -- 2.7.4