mirror of
https://github.com/zulip/zulip.git
synced 2026-06-24 21:08:25 +08:00
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)
This commit is contained in:
parent
f3c8806d30
commit
0cb741d7cc
@ -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")
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user