From 6c4b1965c15d2f9f1b1f00b34e49c38c2e8d484e Mon Sep 17 00:00:00 2001 From: Noah Petherbridge Date: Fri, 23 Aug 2024 22:30:59 -0700 Subject: [PATCH] Code cleanup --- pkg/controller/forum/manage.go | 8 +++++++- pkg/controller/forum/moderators.go | 2 -- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pkg/controller/forum/manage.go b/pkg/controller/forum/manage.go index 9c2e941..7540a1c 100644 --- a/pkg/controller/forum/manage.go +++ b/pkg/controller/forum/manage.go @@ -65,7 +65,13 @@ func Manage() http.HandlerFunc { } pager.ParsePage(r) - forums, err := models.PaginateOwnedForums(currentUser.ID, currentUser.IsAdmin, categories, search, pager) + forums, err := models.PaginateOwnedForums( + currentUser.ID, + currentUser.HasAdminScope(config.ScopeForumAdmin), + categories, + search, + pager, + ) if err != nil { session.FlashError(w, r, "Couldn't paginate owned forums: %s", err) templates.Redirect(w, "/") diff --git a/pkg/controller/forum/moderators.go b/pkg/controller/forum/moderators.go index 1f0a847..3c6e409 100644 --- a/pkg/controller/forum/moderators.go +++ b/pkg/controller/forum/moderators.go @@ -215,8 +215,6 @@ func ModerateThread() http.HandlerFunc { case "unpin": thread.Pinned = false session.Flash(w, r, "This thread will no longer be pinned to the top of the forum.") - default: - session.FlashError(w, r, "Unknown moderator action.") } // Save changes to the thread.