#251 - Disable subscription in community edition (#277)

* #251 - Disable subscription in community edition

* Hide billing routes in sidebar for community edition

* Remove subscription serializer if billing disabled
This commit is contained in:
Sojan Jose
2019-11-24 19:09:17 +05:30
committed by Sony Mathew
parent 54556bfd58
commit 78adcf822d
8 changed files with 70 additions and 41 deletions

View File

@@ -65,6 +65,10 @@ class ApplicationController < ActionController::Base
end
def check_subscription
# This block is left over from the initial version of chatwoot
# We might reuse this later in the hosted version of chatwoot.
return unless ENV['BILLING_ENABLED']
if current_subscription.trial? && current_subscription.expiry < Date.current
render json: { error: 'Trial Expired' }, status: :trial_expired
elsif current_subscription.cancelled?