🔀 Merge branch 'release/v82'
[Sone.git] / src / main / kotlin / net / pterodactylus / sone / web / pages / CreateSonePage.kt
index 9f11e40..959788b 100644 (file)
@@ -16,12 +16,12 @@ import javax.inject.*
 @TemplatePath("/templates/createSone.html")
 @ToadletPath("createSone.html")
 class CreateSonePage @Inject constructor(webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer) :
-               SoneTemplatePage("createSone.html", webInterface, loaders, templateRenderer, pageTitleKey = "Page.CreateSone.Title") {
+               SoneTemplatePage(webInterface, loaders, templateRenderer, pageTitleKey = "Page.CreateSone.Title") {
 
        private val logger = Logger.getLogger(CreateSonePage::class.java.name)
 
        override fun handleRequest(soneRequest: SoneRequest, templateContext: TemplateContext) {
-               templateContext["sones"] = soneRequest.core.localSones.sortedWith(Sone.NICE_NAME_COMPARATOR)
+               templateContext["sones"] = soneRequest.core.localSones.sortedWith(niceNameComparator)
                templateContext["identitiesWithoutSone"] = soneRequest.core.identityManager.allOwnIdentities.filterNot { "Sone" in it.contexts }.sortedBy { "${it.nickname}@${it.id}".toLowerCase() }
                if (soneRequest.isPOST) {
                        val identity = soneRequest.httpRequest.getPartAsStringFailsafe("identity", 43)
@@ -31,7 +31,7 @@ class CreateSonePage @Inject constructor(webInterface: WebInterface, loaders: Lo
                                        logger.log(Level.SEVERE, "Could not create Sone for OwnIdentity: $ownIdentity")
                                }
                                setCurrentSone(soneRequest.toadletContext, sone)
-                               throw RedirectException("index.html")
+                               redirectTo("index.html")
                        }
                        templateContext["errorNoIdentity"] = true
                }