diff --git a/app/models/user.rb b/app/models/user.rb index 4e3bd6a6..5393f7c2 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -64,7 +64,10 @@ def notify(title, message, link = '', type: :default) else notify_slack("*#{title}*\n#{message}\n#{link}") NotificationMailer.with(user: self, title: '[HART] ' + title.to_s, message: (message + link).to_s).notify_email.deliver_now if email_notifications - notification.save # saving might fail, but there is no useful way to handle the error. + notification.save + # saving might fail, there is however no good way to handle this error. + # We cannot log the error, because when using the HartFormatter, logging errors creates new notifications, + # these might also fail to save, creating an endless recursion. end end