added some checks on data in action to reduce runtime issues
Dieser Commit ist enthalten in:
Ursprung
92f626196d
Commit
518a4f3dce
1 geänderte Dateien mit 6 neuen und 1 gelöschten Zeilen
|
@ -143,6 +143,11 @@ class CustomWizard::Action
|
|||
|
||||
notification_level = action['notification_level']
|
||||
|
||||
if notification_level.blank?
|
||||
log_error("Notifcation Level was not set! Exiting wizard action")
|
||||
return
|
||||
end
|
||||
|
||||
mute_remainder = CustomWizard::Mapper.new(
|
||||
inputs: action['mute_remainder'],
|
||||
data: data,
|
||||
|
@ -150,7 +155,7 @@ class CustomWizard::Action
|
|||
).perform
|
||||
|
||||
Category.all.each do |category|
|
||||
if watched_categories.include?(category.id.to_s)
|
||||
if watched_categories.present? && watched_categories.include?(category.id.to_s)
|
||||
CategoryUser.set_notification_level_for_category(user, CategoryUser.notification_levels[notification_level.to_sym], category.id)
|
||||
elsif mute_remainder
|
||||
CategoryUser.set_notification_level_for_category(user, CategoryUser.notification_levels[:muted], category.id)
|
||||
|
|
Laden …
In neuem Issue referenzieren