mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Limit the number of category sidebar links a user can have (#26756)
This commit is contained in:
committed by
GitHub
parent
989d6f921a
commit
e0e0e0506f
@@ -6,6 +6,7 @@ class SidebarSectionLinksUpdater
|
||||
delete_section_links(user: user, linkable_type: "Category")
|
||||
else
|
||||
category_ids = Category.where(id: category_ids).pluck(:id)
|
||||
category_ids = category_ids[...SidebarSection::MAX_USER_CATEGORY_LINKS]
|
||||
update_section_links(user: user, linkable_type: "Category", new_linkable_ids: category_ids)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user