-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Private tournaments #201
base: dev
Are you sure you want to change the base?
Private tournaments #201
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
didn't understand why you kept importing some things directly inside function, especially as you had to reimport it in the same file sometimes. Maybe im missing something, completely possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
insalan/tournament/views/player.py
Outdated
status=status.HTTP_400_BAD_REQUEST | ||
) | ||
tournament = Team.objects.get(pk=data["team"]).tournament | ||
if isinstance(tournament, EventTournament): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part in not clear at all and need a rewrite.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've improved it. This endpoint is used to create a new player. The password field in the data is required in 2 cases:
- When it's an EventTournament, the password must be supplied and must be the same as the team password.
- In the case of a PrivateTournament with password, the password must be supplied and must be the same as the tournament password.
In all other cases (private tournament without password), it makes no difference whether the field is present or not, because for PrivateTournaments, the team has no password.
I hope that's clearer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than that, lgtm !
(I didn't read the tests and didn't try to run most of the code btw)
Description
Related Issues
Fix #162