Skip to content
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

Open
wants to merge 13 commits into
base: dev
Choose a base branch
from
Open

Private tournaments #201

wants to merge 13 commits into from

Conversation

KwikKill
Copy link
Member

@KwikKill KwikKill commented Mar 13, 2025

Description

  • Rework tournament model into two distinct models inheriting from BaseTournament :
    • EventTournament being linked to an Event
    • PrivateTournament being for the anim team
  • Move tests to the test folder

Related Issues

Fix #162

@KwikKill KwikKill marked this pull request as ready for review March 23, 2025 21:52
@KwikKill KwikKill requested a review from floflo0 March 23, 2025 21:52
Copy link

@awing-ding awing-ding left a 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.

Copy link

@awing-ding awing-ding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

status=status.HTTP_400_BAD_REQUEST
)
tournament = Team.objects.get(pk=data["team"]).tournament
if isinstance(tournament, EventTournament):
Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member

@pixup1 pixup1 left a 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)

@KwikKill KwikKill changed the title First draft for private tournament Private tournaments Mar 29, 2025
@KwikKill KwikKill requested review from floflo0 and pixup1 March 29, 2025 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow private tournament creation.
4 participants