Fix bug.
This commit is contained in:
parent
0132cb6cde
commit
17b385d427
|
@ -384,9 +384,16 @@ namespace :sync_asia_personal_plugins do
|
|||
members = MemberProfile.where(:id.in=>member_ids).to_a
|
||||
else
|
||||
members = MemberProfile.where(:email=>/@asia\.edu\.tw$/).to_a
|
||||
members += MemberProfile.where(:id.in=> User.where(:member_profile_id.nin=> members.map(&:id)).pluck(:member_profile_id)).to_a
|
||||
end
|
||||
members.each do |member|
|
||||
user_id = AsiaSyncPlugin.user_id(member)
|
||||
user_id = AsiaSyncPlugin.user_id(member) rescue nil
|
||||
if user_id.blank?
|
||||
user_id = member.user.user_name rescue nil
|
||||
if user_id.nil?
|
||||
next
|
||||
end
|
||||
end
|
||||
puts "Fetching data for #{user_id}..."
|
||||
query_result = get_sync_data(user_id)
|
||||
#puts ["query_result",query_result]
|
||||
|
|
Loading…
Reference in New Issue