Skip to content

Commit

Permalink
strip and clear team code if starting new team
Browse files Browse the repository at this point in the history
  • Loading branch information
eljeffeg committed Apr 20, 2024
1 parent b07ce09 commit 38c5025
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions handlers/PublicHandlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ def create_user(self):

def get_team(self):
"""Create a team object, or pull the existing one"""
code = self.get_argument("team-code", "")
code = self.get_argument("team-code", "").strip()
if len(code) > 0:
team = Team.by_code(code)
if not team:
Expand Down Expand Up @@ -738,7 +738,7 @@ def post(self, *args, **kwargs):
if self.application.settings["suspend_registration"]:
self.render("public/jointeam.html", errors=None, suspend=True)
else:
code = self.get_argument("team-code", "")
code = self.get_argument("team-code", "").strip()
code = self.validate_teamcode(code)
login_hint = self.get_argument("login-hint", None)
if len(login_hint) == 0:
Expand Down
6 changes: 6 additions & 0 deletions static/js/pages/public/registration.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ $(document).ready(function() {
$("#regtoken").popover({placement:'right', trigger:'focus'});
changeTeamMode($("input[name='teammode']:checked").val());

$('input[type="radio"].teammode[value="create"]').change(function() {
if ($(this).is(':checked')) {
$('#team-code').val('');
}
});

/* Avatar */
$(".useravatarimg").click(function() {
var filename = $(this).attr('value');
Expand Down

0 comments on commit 38c5025

Please sign in to comment.