Add team creation disable configuration (#1802)

* Add ability for admins to disable public team creation
* Closes #1364
This commit is contained in:
Kevin Chung
2021-02-12 18:26:03 -05:00
committed by GitHub
parent abdc366bb7
commit 5c9b3e7070
4 changed files with 52 additions and 2 deletions

View File

@@ -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.")