diff --git a/lib/tasks/gitlab.rake b/lib/tasks/gitlab.rake index ffa81e912..729c9245f 100644 --- a/lib/tasks/gitlab.rake +++ b/lib/tasks/gitlab.rake @@ -7,7 +7,7 @@ namespace :gitlab do # User.where(username: 'root').find_each do |user| s = Trustie::Gitlab::Sync.new User.find_each do |user| - s.sync_user(user) + s.sync_user(user) end end diff --git a/lib/trustie/gitlab/sync.rb b/lib/trustie/gitlab/sync.rb index d941795ee..fd04f354d 100644 --- a/lib/trustie/gitlab/sync.rb +++ b/lib/trustie/gitlab/sync.rb @@ -22,7 +22,10 @@ module Trustie def sync_user(user) u = add_user(user) - user.save! if u + if user.mail_notification.blank? or user.mail_notification == "only_assigned" or user.mail_notification == "only_my_events" + user.mail_notification = "day" + end + user.save! end def sync_project(project, opt={})