🔀 Merge branch 'release/v82'
[Sone.git] / src / main / kotlin / net / pterodactylus / sone / web / pages / UnfollowSonePage.kt
index eacaf2e..9dbe9f1 100644 (file)
@@ -11,14 +11,15 @@ import javax.inject.*
 /**
  * This page lets the user unfollow another Sone.
  */
+@ToadletPath("unfollowSone.html")
 class UnfollowSonePage @Inject constructor(webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer) :
-               LoggedInPage("unfollowSone.html", "Page.UnfollowSone.Title", webInterface, loaders, templateRenderer) {
+               LoggedInPage("Page.UnfollowSone.Title", webInterface, loaders, templateRenderer) {
 
        override fun handleRequest(soneRequest: SoneRequest, currentSone: Sone, templateContext: TemplateContext) {
                if (soneRequest.isPOST) {
                        soneRequest.parameters["sone"]!!.split(Regex("[ ,]+"))
                                        .forEach { soneRequest.core.unfollowSone(currentSone, it) }
-                       throw RedirectException(soneRequest.parameters["returnPage", 256])
+                       redirectTo(soneRequest.parameters["returnPage", 256])
                }
        }