mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-20 07:14:24 +01:00
Add setting to allow MLC registration only (#1259)
* Adds a setting to registration visibility to allow for MLC registration while registration is disabled
This commit is contained in:
@@ -11,6 +11,7 @@ from CTFd.utils import config, email, get_app_config, get_config
|
||||
from CTFd.utils import user as current_user
|
||||
from CTFd.utils import validators
|
||||
from CTFd.utils.config import is_teams_mode
|
||||
from CTFd.utils.config.integrations import mlc_registration
|
||||
from CTFd.utils.config.visibility import registration_visible
|
||||
from CTFd.utils.crypto import verify_password
|
||||
from CTFd.utils.decorators import ratelimit
|
||||
@@ -384,7 +385,7 @@ def oauth_redirect():
|
||||
user = Users.query.filter_by(email=user_email).first()
|
||||
if user is None:
|
||||
# Check if we are allowing registration before creating users
|
||||
if registration_visible():
|
||||
if registration_visible() or mlc_registration():
|
||||
user = Users(
|
||||
name=user_name,
|
||||
email=user_email,
|
||||
|
||||
Reference in New Issue
Block a user