From bf06a6cafd8de3b55875404d658e60340a61e4f0 Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 29 Oct 2015 12:33:22 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=95=B0=E6=8D=AE=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E9=97=AE=E9=A2=98=EF=BC=88=E5=8E=86=E5=8F=B2=E9=82=AE?= =?UTF-8?q?=E4=BB=B6=E9=80=9A=E7=9F=A5validate=E9=97=AE=E9=A2=98=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/gitlab.rake | 2 +- lib/trustie/gitlab/sync.rb | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) 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={})