billing: Set max_invites to 3000 for Premium organizations.

This is meant to be effectively infinite for legitimate use.
This commit is contained in:
Vishnu Ks 2018-08-22 11:36:37 +00:00 committed by Tim Abbott
parent ba4e4e38ae
commit 7b307fa58f
3 changed files with 6 additions and 0 deletions

View File

@ -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

View File

@ -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 = ''

View File

@ -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)