mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Include default notification level in category serializer (#9572)
Fixes an issue where the notification level state goes missing when user edits a category in the UI.
This commit is contained in:
@@ -83,8 +83,9 @@ class CategorySerializer < SiteCategorySerializer
|
||||
|
||||
def notification_level
|
||||
user = scope && scope.user
|
||||
object.notification_level ||
|
||||
(user && CategoryUser.where(user: user, category: object).first.try(:notification_level))
|
||||
object.notification_level ||
|
||||
(user && CategoryUser.where(user: user, category: object).first.try(:notification_level)) ||
|
||||
CategoryUser.default_notification_level
|
||||
end
|
||||
|
||||
def custom_fields
|
||||
|
||||
Reference in New Issue
Block a user