mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 05:23:35 +00:00
billing: Allow to exclude realms from license limit check.
This commit is contained in:
@@ -71,12 +71,10 @@ def send_user_unable_to_signup_message_to_signup_notification_stream(
|
||||
def check_spare_licenses_available_for_adding_new_users(
|
||||
realm: Realm, number_of_users_to_add: int
|
||||
) -> None:
|
||||
if realm.string_id in settings.LICENSE_CHECK_EXEMPTED_REALMS_ON_MANUAL_PLAN:
|
||||
return # nocoverage
|
||||
|
||||
plan = get_current_plan_by_realm(realm)
|
||||
if plan is None or plan.automanage_licenses:
|
||||
if plan is None or plan.automanage_licenses or plan.exempt_from_from_license_number_check:
|
||||
return
|
||||
|
||||
if plan.licenses() < get_latest_seat_count(realm) + number_of_users_to_add:
|
||||
raise LicenseLimitError()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user