diff --git a/CTFd/forms/teams.py b/CTFd/forms/teams.py index fc047cad..e06da7c9 100644 --- a/CTFd/forms/teams.py +++ b/CTFd/forms/teams.py @@ -20,12 +20,28 @@ class TeamRegisterForm(BaseForm): class TeamSettingsForm(BaseForm): - name = StringField("Team Name") - confirm = PasswordField("Current Password") - password = PasswordField("Team Password") - affiliation = StringField("Affiliation") - website = URLField("Website") - country = SelectField("Country", choices=SELECT_COUNTRIES_LIST) + name = StringField( + "Team Name", description="Your team's public name shown to other competitors" + ) + password = PasswordField( + "New Team Password", description="Set a new team join password" + ) + confirm = PasswordField( + "Confirm Password", + description="Provide your current team password (or your password) to update your team's password", + ) + affiliation = StringField( + "Affiliation", + description="Your team's affiliation publicly shown to other competitors", + ) + website = URLField( + "Website", description="Your team's website publicly shown to other competitors" + ) + country = SelectField( + "Country", + choices=SELECT_COUNTRIES_LIST, + description="Your team's country publicly shown to other competitors", + ) submit = SubmitField("Submit") diff --git a/CTFd/schemas/teams.py b/CTFd/schemas/teams.py index be02c5fd..669a6ed0 100644 --- a/CTFd/schemas/teams.py +++ b/CTFd/schemas/teams.py @@ -142,10 +142,13 @@ class TeamSchema(ma.ModelSchema): ) if password and confirm: - test = verify_password( + test_team = verify_password( plaintext=confirm, ciphertext=current_team.password ) - if test is True: + test_captain = verify_password( + plaintext=confirm, ciphertext=current_user.password + ) + if test_team is True or test_captain is True: return data else: raise ValidationError( diff --git a/CTFd/themes/core/templates/teams/private.html b/CTFd/themes/core/templates/teams/private.html index ad34a64e..45d3e63d 100644 --- a/CTFd/themes/core/templates/teams/private.html +++ b/CTFd/themes/core/templates/teams/private.html @@ -5,7 +5,7 @@ {% block content %}