1
0
Fork 0

added some checks on data in action to reduce runtime issues

Dieser Commit ist enthalten in:
Robert Barrow 2020-05-26 10:59:11 +01:00
Ursprung 92f626196d
Commit 518a4f3dce

Datei anzeigen

@ -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)