From 0cb741d7ccd16c19de95e4c5a36d235d6fb33e28 Mon Sep 17 00:00:00 2001 From: Luke Faraone Date: Sun, 11 Aug 2013 15:57:54 -0700 Subject: [PATCH] Removed confusing ALLOW_REGISTER setting. ALLOW_REGISTER was no longer being used in determining whether you could register for the app, so I've removed it to avoid additional local-dev / production issues. This closes #1613. (imported from commit c928c6d350602d35f745ae1e60d734e4567885fc) --- zerver/forms.py | 6 +----- zerver/lib/actions.py | 7 +++---- zerver/views.py | 11 +++++------ zproject/settings.py | 2 -- 4 files changed, 9 insertions(+), 17 deletions(-) diff --git a/zerver/forms.py b/zerver/forms.py index 01e5e33813..a2f0bdae1a 100644 --- a/zerver/forms.py +++ b/zerver/forms.py @@ -55,11 +55,7 @@ class HomepageForm(forms.Form): # This form is important because it determines whether users can # register for our product. Be careful when modifying the # validators. - if settings.ALLOW_REGISTER: - email = forms.EmailField() - else: - validators = [is_inactive] - email = forms.EmailField(validators=validators) + email = forms.EmailField(validators=[is_inactive,]) def __init__(self, *args, **kwargs): self.domain = kwargs.get("domain") diff --git a/zerver/lib/actions.py b/zerver/lib/actions.py index 24a85f66e9..67b32128c1 100644 --- a/zerver/lib/actions.py +++ b/zerver/lib/actions.py @@ -1391,10 +1391,9 @@ def do_invite_users(user_profile, invitee_emails, streams): # Redundant check in case earlier validation preventing MIT users from # inviting people fails. - if settings.ALLOW_REGISTER == False: - if "@mit.edu" in email: - errors.append((email, "Invitations are not enabled for MIT at this time.")) - continue + if "@mit.edu" in email: + errors.append((email, "Invitations are not enabled for MIT at this time.")) + continue try: user_email_is_unique(email) diff --git a/zerver/views.py b/zerver/views.py index 5a22bb1e5a..078464d523 100644 --- a/zerver/views.py +++ b/zerver/views.py @@ -402,11 +402,10 @@ def api_endpoint_docs(request): @has_request_variables def json_invite_users(request, user_profile, invitee_emails=REQ): # Validation - if settings.ALLOW_REGISTER == False: - try: - isnt_mit(user_profile.email) - except ValidationError, e: - return json_error(e.message) + try: + isnt_mit(user_profile.email) + except ValidationError, e: + return json_error(e.message) if not invitee_emails: return json_error("You must specify at least one email address.") @@ -620,7 +619,7 @@ def home(request): isnt_mit(user_profile.email) show_invites = True except ValidationError: - show_invites = settings.ALLOW_REGISTER + show_invites = False # For the CUSTOMER4 student realm, only let instructors (who have # @customer4.invalid addresses) invite new users. diff --git a/zproject/settings.py b/zproject/settings.py index 821c020f58..8d29aac380 100644 --- a/zproject/settings.py +++ b/zproject/settings.py @@ -586,10 +586,8 @@ TUTORIAL_ENABLED = True HOME_NOT_LOGGED_IN = '/login' if DEPLOYED: - ALLOW_REGISTER = False FULL_NAVBAR = False else: - ALLOW_REGISTER = True FULL_NAVBAR = True # For testing, you may want to have emails be printed to the console.