diff --git a/handlers/PublicHandlers.py b/handlers/PublicHandlers.py index 9d58abee..f0f50527 100644 --- a/handlers/PublicHandlers.py +++ b/handlers/PublicHandlers.py @@ -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: @@ -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: diff --git a/static/js/pages/public/registration.js b/static/js/pages/public/registration.js index ea5e5087..45cc8539 100644 --- a/static/js/pages/public/registration.js +++ b/static/js/pages/public/registration.js @@ -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');