From 41195aaa6e372cc477d341d2c8ddfcb246e234f0 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Tue, 28 May 2019 20:27:10 +0800 Subject: [PATCH] fix create cnmooc --- app/services/cnmoocs_service.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/services/cnmoocs_service.rb b/app/services/cnmoocs_service.rb index 4c287455..d231ceae 100644 --- a/app/services/cnmoocs_service.rb +++ b/app/services/cnmoocs_service.rb @@ -85,12 +85,14 @@ class CnmoocsService lastname: name, mail: mail, mail_notification: mail, - login: login, password: OauthController::DEFAULT_PASSWORD, certification: 1 } ActiveRecord::Base.transaction do - user = User.create!(create_params) + user = User.new(create_params) + # login 有问题,只能这样赋值 + user.login = login + user.save! UserExtensions.create!(user_id: user.id, school_id: School.first.id, identity: 4, gender: 0)