Code cleanup

This commit is contained in:
Noah Petherbridge 2024-08-23 22:30:59 -07:00
parent 90b32c01ed
commit 6c4b1965c1
2 changed files with 7 additions and 3 deletions

View File

@ -65,7 +65,13 @@ func Manage() http.HandlerFunc {
} }
pager.ParsePage(r) 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 { if err != nil {
session.FlashError(w, r, "Couldn't paginate owned forums: %s", err) session.FlashError(w, r, "Couldn't paginate owned forums: %s", err)
templates.Redirect(w, "/") templates.Redirect(w, "/")

View File

@ -215,8 +215,6 @@ func ModerateThread() http.HandlerFunc {
case "unpin": case "unpin":
thread.Pinned = false thread.Pinned = false
session.Flash(w, r, "This thread will no longer be pinned to the top of the forum.") 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. // Save changes to the thread.