Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added ALLOW_SIGNUP setting in accounts to enable/disable signups in t… #3579

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion allauth/account/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def is_open_for_signup(self, request):
Next to simply returning True/False you can also intervene the
regular flow by raising an ImmediateHttpResponse
"""
return True
return app_settings.ALLOW_SIGNUP
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Naming wise this is inconsistent with the adapter method, would have accepted IS_OPEN_FOR_SIGNUP?


def new_user(self, request):
"""
Expand Down
7 changes: 7 additions & 0 deletions allauth/account/app_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,13 @@ def UNIQUE_EMAIL(self):
Enforce uniqueness of email addresses
"""
return self._setting("UNIQUE_EMAIL", True)

@property
def ALLOW_SIGNUP(self):
"""
Allow new registrations.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a new setting -- it requires documentation.

"""
return self._setting("ALLOW_SIGNUP", True)

@property
def SIGNUP_EMAIL_ENTER_TWICE(self):
Expand Down
Loading