Hi Marc,
On 09/11/17 17:05, Marc Furon wrote:
Also, I am trying to import team accounts with passwords. I used the format in the standards document, using the team names as the "Full Name". I get this SQL error when doing the import:
error: SQL error, Error#1452: Cannot add or update a child row: a foreign key constraint fails (`domjudge`.`user`, CONSTRAINT `user_ibfk_1` FOREIGN KEY (`teamid`) REFERENCES `team` (`teamid`) ON DELETE SET NULL), query: 'REPLACE INTO user SET `name` = "Big Ballers", `username` = "acm101", `password` = "$2y$10$ILEqS5X6w93RVQ/euA1UYeTKXseyUAK9efUnmMknnk5CPprWvCg/K", `teamid` = "acm101"'
Here are the first few lines of the team account file:
accounts 1 team Big Ballers acm101 password1 team Brain Dead Simple acm102 password2 team Kernel Sanders acm103 password3
The teams imported correctly and exist with the given names.
On a second look: the problem is that your account file is not quite up to spec, and we're arguably not very fault tolerant in parsing it. According to the specification [1] a team account should be of the form "team-nnn" where nnn is a number with leading zeros. Our code doesn't recognize "acm101". This can be "fixed" by editing this line: https://github.com/DOMjudge/domjudge/blob/5.3/www/jury/impexp_tsv.php#L192
Clearly, we have to think of a more flexible way of dealing with this and implement better error handling.
Best, Jaap
[1] https://clics.ecs.baylor.edu/index.php/Contest_Control_System_Requirements#a...