Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

actions: Downgrade realm before scrubbing.

Vishnu KS367c792968d9
diff --git a/zerver/lib/actions.py b/zerver/lib/actions.py
index 2597d16c6d3..1e8f9c1f46e 100644
--- a/zerver/lib/actions.py
+++ b/zerver/lib/actions.py
@@ -852,6 +852,9 @@ def do_change_realm_subdomain(realm: Realm, new_subdomain: str) -> None:
realm.save(update_fields=["string_id"])
def do_scrub_realm(realm: Realm, acting_user: Optional[UserProfile]=None) -> None:
+ if settings.BILLING_ENABLED:
+ downgrade_now_without_creating_additional_invoices(realm)
+
users = UserProfile.objects.filter(realm=realm)
for user in users:
do_delete_messages_by_sender(user)