fix error
This commit is contained in:
parent
ca7a5bca12
commit
6598636124
|
@ -29,7 +29,7 @@ class Admin::RegisterApiController < ApplicationController
|
|||
response["error"] = "SITE_ALREADY_REGISTERED"
|
||||
end
|
||||
if !site.nil?
|
||||
p1 = fork {register_client_site(site.site_token) }
|
||||
p1 = fork {register_client_site(site,site.site_token) }
|
||||
Process.detach(p1)
|
||||
end
|
||||
render :json => ((params[:success] == 'error') ? response.merge({'success'=>params[:success]}).to_json : response.to_json)
|
||||
|
@ -65,8 +65,7 @@ class Admin::RegisterApiController < ApplicationController
|
|||
watch_list_save_flag = (params['user']!= 'rulingcom' && params['user'].to_s != '')
|
||||
user_name = params['user']
|
||||
puts ['user_name',user_name]
|
||||
site_anncs = SiteAnnc
|
||||
.where(visible: true)
|
||||
site_anncs = SiteAnnc.where(visible: true)
|
||||
.select{|v| v.send_all || v.recieve_sites.include?(site)}.collect do |v|
|
||||
if watch_list_save_flag
|
||||
watch_list = v.watch_list
|
||||
|
@ -103,7 +102,10 @@ class Admin::RegisterApiController < ApplicationController
|
|||
render :json => ((params[:success] == 'error') ? response.merge(params).to_json : response.to_json)
|
||||
end
|
||||
|
||||
def register_client_site(store_token)
|
||||
def register_client_site(site=nil,store_token)
|
||||
if !site.nil?
|
||||
send_confirmation_email(site.admin_email, site.confirmation_token, site.site_token)
|
||||
end
|
||||
params_to_send = {'store_token' => store_token, "site_token" => params[:site_token]}
|
||||
uri = URI.parse("http://#{params[:site_domain]}/")
|
||||
http = Net::HTTP.new(uri.host,uri.port)
|
||||
|
|
Loading…
Reference in New Issue