From: David ‘Bombe’ Roden Date: Wed, 29 Nov 2017 21:11:01 +0000 (+0100) Subject: Actually store the profile back in the Sone X-Git-Tag: 0.9.8^2~3 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=da022230e20fcc8e133f059ab9ffdc60eb50d202;p=Sone.git Actually store the profile back in the Sone --- 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)) }