Store the real album object in the template context
[Sone.git] / src / main / java / net / pterodactylus / sone / web / DeleteAlbumPage.java
index 94fbaf1..41cd4b8 100644 (file)
@@ -49,8 +49,7 @@ public class DeleteAlbumPage extends SoneTemplatePage {
         * {@inheritDoc}
         */
        @Override
-       protected void processTemplate(FreenetRequest request, TemplateContext templateContext) throws RedirectException {
-               super.processTemplate(request, templateContext);
+       protected void processSonePage(FreenetRequest request, TemplateContext templateContext) throws RedirectException {
                if (request.getMethod() == Method.POST) {
                        String albumId = request.getHttpRequest().getPartAsStringFailsafe("album", IdBuilder.ID_STRING_LENGTH);
                        Optional<Album> album = webInterface.getCore().getAlbum(albumId);
@@ -75,7 +74,7 @@ public class DeleteAlbumPage extends SoneTemplatePage {
                if (!album.isPresent()) {
                        throw new RedirectException("invalid.html");
                }
-               templateContext.set("album", album);
+               templateContext.set("album", album.get());
        }
 
 }