Merge branch 'master' into 'master'
fix error See merge request harry/registered-sites!3
This commit is contained in:
commit
e4ac28c1da
|
@ -29,7 +29,8 @@ class Admin::RegisterApiController < ApplicationController
|
|||
response["error"] = "SITE_ALREADY_REGISTERED"
|
||||
end
|
||||
if !site.nil?
|
||||
p1 = fork {register_client_site(site.site_token) }
|
||||
send_confirmation_email(site.admin_email, site.confirmation_token, 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 +66,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 +103,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