mirror of https://github.com/zulip/zulip.git
billing: Set max_invites to 3000 for Premium organizations.
This is meant to be effectively infinite for legitimate use.
This commit is contained in:
parent
ba4e4e38ae
commit
7b307fa58f
|
@ -3027,6 +3027,10 @@ def do_change_plan_type(user: UserProfile, plan_type: int) -> None:
|
|||
realm=realm, acting_user=user, event_time=timezone_now(),
|
||||
extra_data={'old_value': old_value, 'new_value': plan_type})
|
||||
|
||||
if plan_type == Realm.PREMIUM:
|
||||
realm.max_invites = Realm.MAX_INVITES_PREMIUM
|
||||
realm.save(update_fields=['_max_invites'])
|
||||
|
||||
def do_change_default_sending_stream(user_profile: UserProfile, stream: Optional[Stream],
|
||||
log: bool=True) -> None:
|
||||
user_profile.default_sending_stream = stream
|
||||
|
|
|
@ -143,6 +143,7 @@ class Realm(models.Model):
|
|||
MAX_REALM_SUBDOMAIN_LENGTH = 40
|
||||
MAX_VIDEO_CHAT_PROVIDER_LENGTH = 40
|
||||
MAX_GOOGLE_HANGOUTS_DOMAIN_LENGTH = 255 # This is just the maximum domain length by RFC
|
||||
MAX_INVITES_PREMIUM = 3000
|
||||
VIDEO_CHAT_PROVIDERS = [u"Jitsi", u"Google Hangouts"]
|
||||
AUTHENTICATION_FLAGS = [u'Google', u'Email', u'GitHub', u'LDAP', u'Dev', u'RemoteUser']
|
||||
SUBDOMAIN_FOR_ROOT_DOMAIN = ''
|
||||
|
|
|
@ -150,6 +150,7 @@ class StripeTest(ZulipTestCase):
|
|||
realm = get_realm("zulip")
|
||||
self.assertTrue(realm.has_seat_based_plan)
|
||||
self.assertEqual(realm.plan_type, Realm.PREMIUM)
|
||||
self.assertEqual(realm.max_invites, Realm.MAX_INVITES_PREMIUM)
|
||||
# Check that we can no longer access /upgrade
|
||||
response = self.client_get("/upgrade/")
|
||||
self.assertEqual(response.status_code, 302)
|
||||
|
|
Loading…
Reference in New Issue