POLIMI-FER-codebenders / tournament_app

Tournament app for Code Defenders made by student team of POLIMI and FER students
GNU Lesser General Public License v3.0
0 stars 0 forks source link

teams are not deleted after leader exits successfully #107

Closed FabioPatella closed 1 year ago

FabioPatella commented 1 year ago

when the ledear successfully exit from the team , the team is not deleted ( and in the db is still present with -1 number of players if the leader was alone in the team when he has left).

SimoneMezzaro commented 1 year ago

"It's not a bug, it's a feature". Jokes aside, this behavior is intentional. Deleting the team from the database violates some foreign keys constraints. For example old tournaments in which the team participated will have references to the team, which are actually also visible in the user interface (for example you can still see the winner of an old tournament even if the winning team has been deleted).

If the problem is that the name of a deleted team can't be used anymore, this can actually be solved by checking that team names are unique only for valid teams. But allowing reusing names of deleted teams has still some problems. For example you can take the name of a deleted team which won some past tournaments and from the user interface it will seem as if your team has won those tournaments.

FabioPatella commented 1 year ago

it makes sense ( we can just say that it is not possible to use a name of a inactive team for the reason you have listed)