mirror of https://github.com/zulip/zulip.git
billing: Rename downgrade_realm_for_deactivation to downgrade_now.
This commit is contained in:
parent
aca80206df
commit
3f69500765
|
@ -500,7 +500,7 @@ def estimate_annual_recurring_revenue_by_realm() -> Dict[str, int]: # nocoverag
|
||||||
|
|
||||||
# During realm deactivation we instantly downgrade the plan to Limited.
|
# During realm deactivation we instantly downgrade the plan to Limited.
|
||||||
# Extra users added in the final month are not charged.
|
# Extra users added in the final month are not charged.
|
||||||
def downgrade_for_realm_deactivation(realm: Realm) -> None:
|
def downgrade_now(realm: Realm) -> None:
|
||||||
plan = get_current_plan_by_realm(realm)
|
plan = get_current_plan_by_realm(realm)
|
||||||
if plan is None:
|
if plan is None:
|
||||||
return
|
return
|
||||||
|
|
|
@ -163,7 +163,7 @@ from zerver.lib.streams import access_stream_for_send_message, subscribed_to_str
|
||||||
from analytics.models import StreamCount
|
from analytics.models import StreamCount
|
||||||
|
|
||||||
if settings.BILLING_ENABLED:
|
if settings.BILLING_ENABLED:
|
||||||
from corporate.lib.stripe import update_license_ledger_if_needed, downgrade_for_realm_deactivation
|
from corporate.lib.stripe import update_license_ledger_if_needed, downgrade_now
|
||||||
|
|
||||||
import ujson
|
import ujson
|
||||||
import time
|
import time
|
||||||
|
@ -710,7 +710,7 @@ def do_deactivate_realm(realm: Realm, acting_user: Optional[UserProfile]=None) -
|
||||||
realm.save(update_fields=["deactivated"])
|
realm.save(update_fields=["deactivated"])
|
||||||
|
|
||||||
if settings.BILLING_ENABLED:
|
if settings.BILLING_ENABLED:
|
||||||
downgrade_for_realm_deactivation(realm)
|
downgrade_now(realm)
|
||||||
|
|
||||||
event_time = timezone_now()
|
event_time = timezone_now()
|
||||||
RealmAuditLog.objects.create(
|
RealmAuditLog.objects.create(
|
||||||
|
|
Loading…
Reference in New Issue