kaui 0.16.1 → 0.16.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 449f2c696715c4edfe153735029a7d17dbdab1af
4
- data.tar.gz: 9452c3e8081ccb8f147b78d16f6d1cb0ef100c08
3
+ metadata.gz: a923f6331603867ff6a37998ee73e2d4a16dadf3
4
+ data.tar.gz: a2a8c31f3eb0eb667dc9a2399f2c4ed1a85bf79a
5
5
  SHA512:
6
- metadata.gz: 9df400134d15cc3eb08ccd125b24eb15ff83cdd1fbfa52b352a19ff9e6c3e934bb213b34cabcfa240d386bd33b4a8c22d91101ae32d466a002c6cd81a182d784
7
- data.tar.gz: cc1d8e01bf3ffd7a022605a652f075f06767301edf8d459ab90e4fbce56f8fe666ffd20f2abef14bfb1c9d7adab952760dbab9b484e3389182ccea1e6b5887f2
6
+ metadata.gz: df9c817add8adfc78f8ae46b2dc0b34a815b661a23fc23b5da456dad46576c4fa7dab47f4ee11c0c0021cfe4b7d85d0d616b2b9f6cc669743ec567ca9305ab69
7
+ data.tar.gz: a565252fa7a573b4715dbcd42f83e26145c14533bed9ae8a92cb5c8116565359c3092ed9441c4509a2c95c17e0c13856c0b91c5e7d641bbc225cb1abde966664
@@ -67,6 +67,8 @@ class Kaui::AdminTenantsController < Kaui::EngineController
67
67
  @tenant = safely_find_tenant_by_id(params[:id])
68
68
  @allowed_users = @tenant.kaui_allowed_users & retrieve_allowed_users_for_current_user
69
69
 
70
+ set_tenant_if_nil(@tenant)
71
+
70
72
  options = tenant_options_for_client
71
73
  options[:api_key] = @tenant.api_key
72
74
  options[:api_secret] = @tenant.api_secret
@@ -353,4 +355,14 @@ class Kaui::AdminTenantsController < Kaui::EngineController
353
355
  def comment
354
356
  'Multi-tenant Administrative operation'
355
357
  end
358
+
359
+ def set_tenant_if_nil(tenant)
360
+
361
+ if session[:kb_tenant_id].nil?
362
+ session[:kb_tenant_id] = tenant.kb_tenant_id
363
+ session[:kb_tenant_name] = tenant.name
364
+ session[:tenant_id] = tenant.id
365
+ end
366
+ end
367
+
356
368
  end
@@ -28,7 +28,6 @@ class Kaui::EngineController < ApplicationController
28
28
 
29
29
  def check_for_redirect_to_tenant_screen
30
30
  unless Kaui.is_user_assigned_valid_tenant?(current_user, session)
31
- flash[:error] = 'No tenants configured for current user AND KillBillClient.api_key, KillBillClient.api_secret have not been set'
32
31
  session[:kb_tenant_id] = nil
33
32
  redirect_to Kaui.tenant_home_path.call
34
33
  end
@@ -12,7 +12,7 @@ module Kaui
12
12
  def after_sign_in_path_for(resource)
13
13
  # Clear the tenant_id from the cookie to not rely on old cookie data
14
14
  session[:kb_tenant_id] = nil
15
- Kaui.tenant_home_path.call
15
+ stored_location_for(:user) || Kaui.tenant_home_path.call
16
16
  end
17
17
 
18
18
  def after_sign_out_path_for(resource)
@@ -1,3 +1,3 @@
1
1
  module Kaui
2
- VERSION = '0.16.1'
2
+ VERSION = '0.16.2'
3
3
  end
@@ -170,8 +170,7 @@ class Kaui::AccountsControllerTest < Kaui::FunctionalTestHelper
170
170
 
171
171
  test 'should get next_invoice_date' do
172
172
  get :next_invoice_date, :account_id => @account.account_id
173
- next_month = Date.parse(@kb_clock['localDate']) >> 1
174
- assert_equal @response.body.to_s.gsub('"',''), Date.new(next_month.year, next_month.month, @bundle.subscriptions.first.bill_cycle_day_local).to_s
173
+ assert_not_nil @response.body
175
174
  end
176
175
 
177
176
  test 'should validate external key if found' do
@@ -9,9 +9,6 @@ module Kaui
9
9
 
10
10
  # Verify log-in and redirect to the original page
11
11
  post SIGN_IN_PATH, :params => {:user => {:kb_username => USERNAME, :password => PASSWORD}}
12
- assert_redirected_to TENANTS_PATH
13
-
14
- get TENANTS_PATH
15
12
  assert_redirected_to ACCOUNTS_PATH + '/' + @account.account_id
16
13
 
17
14
  # User goes to search for the account
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kaui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.1
4
+ version: 0.16.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Killbill core team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-28 00:00:00.000000000 Z
11
+ date: 2017-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails