mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-22 08:14:24 +01:00
Add team creation disable configuration (#1802)
* Add ability for admins to disable public team creation * Closes #1364
This commit is contained in:
@@ -191,6 +191,12 @@ def new():
|
||||
infos = get_infos()
|
||||
errors = get_errors()
|
||||
|
||||
if bool(get_config("team_creation", default=True)) is False:
|
||||
abort(
|
||||
403,
|
||||
description="Team creation is currently disabled. Please join an existing team.",
|
||||
)
|
||||
|
||||
user = get_current_user_attrs()
|
||||
if user.team_id:
|
||||
errors.append("You are already in a team. You cannot join another.")
|
||||
|
||||
Reference in New Issue
Block a user