Backend: handle registration

This commit is contained in:
nemunaire 2016-03-06 18:59:33 +01:00 committed by Pierre-Olivier Mercier
parent 1d8f9b0785
commit d30b4946b3
2 changed files with 43 additions and 2 deletions

View file

@ -105,8 +105,16 @@ func treat(raw_path string) {
// Extract
spath := strings.Split(strings.TrimPrefix(raw_path, SubmissionDir), "/")
if len(spath) > 2 {
treatSubmission(raw_path, spath[1], spath[2])
if len(spath) == 3 {
if spath[1] == "_registration" {
treatRegistration(raw_path)
} else if team, err := fic.GetTeamByInitialName(spath[1]); err != nil {
log.Println("[ERR]", err)
} else if spath[2] == "name" {
treatRename(raw_path, team)
} else {
treatSubmission(raw_path, team, spath[2])
}
} else {
log.Println("Invalid new file:", raw_path)
}