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.

corporate: Increase Cloud Plus storage limit.

Alya Abbott166267bca9cc
diff --git a/templates/corporate/pricing_model.html b/templates/corporate/pricing_model.html
index 6504548eb91..408ab20cc5b 100644
--- a/templates/corporate/pricing_model.html
+++ b/templates/corporate/pricing_model.html
@@ -129,6 +129,7 @@
<h2 class="with-fine-print">Plus <small>10 users minimum</small></h2>
<ul class="feature-list">
<li><span>All Standard plan features</span></li>
+ <li><span>File storage up to 25 GB per user</span></li>
<li><span><a href="/help/saml-authentication">SSO with SAML</a> (Okta, OneLogIn, etc.)</span></li>
<li><span><a href="/help/scim">SCIM user and group sync</a></span></li>
<li><span><a href="/help/change-organization-url">Custom domain</a></span></li>
diff --git a/zerver/models/realms.py b/zerver/models/realms.py
index ed2fe4ef21b..8e3ea8f8daa 100644
--- a/zerver/models/realms.py
+++ b/zerver/models/realms.py
@@ -1087,12 +1087,20 @@ class Realm(models.Model):
return Realm.UPLOAD_QUOTA_LIMITED
elif plan_type == Realm.PLAN_TYPE_STANDARD_FREE:
return Realm.UPLOAD_QUOTA_STANDARD_FREE
- elif plan_type in [Realm.PLAN_TYPE_STANDARD, Realm.PLAN_TYPE_PLUS]:
+ elif plan_type == Realm.PLAN_TYPE_STANDARD:
from corporate.lib.stripe import get_cached_seat_count
# Paying customers with few users should get a reasonable minimum quota.
return max(
- get_cached_seat_count(self) * settings.UPLOAD_QUOTA_PER_USER_GB,
+ get_cached_seat_count(self) * settings.UPLOAD_QUOTA_PER_USER_GB_FOR_STANDARD,
+ Realm.UPLOAD_QUOTA_STANDARD_FREE,
+ )
+ elif plan_type == Realm.PLAN_TYPE_PLUS:
+ from corporate.lib.stripe import get_cached_seat_count
+
+ # Paying customers with few users should get a reasonable minimum quota.
+ return max(
+ get_cached_seat_count(self) * settings.UPLOAD_QUOTA_PER_USER_GB_FOR_PLUS,
Realm.UPLOAD_QUOTA_STANDARD_FREE,
)
else:
diff --git a/zerver/tests/test_realm.py b/zerver/tests/test_realm.py
index a48d0199d26..56e40fc8fa8 100644
--- a/zerver/tests/test_realm.py
+++ b/zerver/tests/test_realm.py
@@ -1552,7 +1552,8 @@ class RealmTest(ZulipTestCase):
self.assertEqual(realm.max_invites, Realm.INVITES_STANDARD_REALM_DAILY_MAX)
self.assertEqual(realm.message_visibility_limit, None)
self.assertEqual(
- realm.upload_quota_gb, get_seat_count(realm) * settings.UPLOAD_QUOTA_PER_USER_GB
+ realm.upload_quota_gb,
+ get_seat_count(realm) * settings.UPLOAD_QUOTA_PER_USER_GB_FOR_STANDARD,
)
everyone_system_group = NamedUserGroup.objects.get(
name=SystemGroups.EVERYONE, realm_for_sharding=realm
@@ -1582,7 +1583,8 @@ class RealmTest(ZulipTestCase):
self.assertEqual(realm.max_invites, Realm.INVITES_STANDARD_REALM_DAILY_MAX)
self.assertEqual(realm.message_visibility_limit, None)
self.assertEqual(
- realm.upload_quota_gb, get_seat_count(realm) * settings.UPLOAD_QUOTA_PER_USER_GB
+ realm.upload_quota_gb,
+ get_seat_count(realm) * settings.UPLOAD_QUOTA_PER_USER_GB_FOR_PLUS,
)
do_change_realm_permission_group_setting(
@@ -1594,7 +1596,8 @@ class RealmTest(ZulipTestCase):
self.assertEqual(realm.max_invites, Realm.INVITES_STANDARD_REALM_DAILY_MAX)
self.assertEqual(realm.message_visibility_limit, None)
self.assertEqual(
- realm.upload_quota_gb, get_seat_count(realm) * settings.UPLOAD_QUOTA_PER_USER_GB
+ realm.upload_quota_gb,
+ get_seat_count(realm) * settings.UPLOAD_QUOTA_PER_USER_GB_FOR_STANDARD,
)
self.assertEqual(realm.can_access_all_users_group_id, everyone_system_group.id)
diff --git a/zproject/default_settings.py b/zproject/default_settings.py
index 69c52798070..8d3f8113e7b 100644
--- a/zproject/default_settings.py
+++ b/zproject/default_settings.py
@@ -174,9 +174,13 @@ LOCAL_UPLOADS_DIR: str | None = None
LOCAL_AVATARS_DIR: str | None = None
LOCAL_FILES_DIR: str | None = None
MAX_FILE_UPLOAD_SIZE = 100
-# How many GB an organization on a paid plan can upload per user,
+# How many GB an organization on a cloud standard plan can upload per user,
# on zulipchat.com.
-UPLOAD_QUOTA_PER_USER_GB = 5
+UPLOAD_QUOTA_PER_USER_GB_FOR_STANDARD = 5
+
+# How many GB an organization on a cloud plus plan can upload per user,
+# on zulipchat.com.
+UPLOAD_QUOTA_PER_USER_GB_FOR_PLUS = 25
# Jitsi Meet video call integration; set to None to disable integration.
JITSI_SERVER_URL: str | None = "https://meet.jit.si"