Browse Source

change

tags/v1.0.0
sylor_huang@126.com 6 years ago
parent
commit
eedaba9bed
1 changed files with 8 additions and 1 deletions
  1. +8
    -1
      app/controllers/sync_forge_controller.rb

+ 8
- 1
app/controllers/sync_forge_controller.rb View File

@@ -46,8 +46,15 @@ class SyncForgeController < ApplicationController
if User.exists?(login: u[:user_params][:login])
SyncLog.sync_log("=================sync_to_user_been_exists====#{u[:user_params][:login]}")
else
new_user = User.new(u[:user_params])
if u[:user_params][:mail].blank?
u_mail = "#{u[:user_params][:login]}@example.com"
else
u_mail = u[:user_params][:mail]
end
new_user = User.new(u[:user_params].merge(mail: u_mail))
username = new_user.login

password = "12345678"
ActiveRecord::Base.transaction do
interactor = Gitea::RegisterInteractor.call({username: username, email: new_user.mail, password: password})


Loading…
Cancel
Save