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

Can't request scrimmages in a team with a name of a previously-deleted team #64

Open
jmerle opened this issue Jan 12, 2019 · 1 comment

Comments

@jmerle
Copy link

jmerle commented Jan 12, 2019

Here's what I did:

  1. Create a team named '∞'
  2. Leave my team
  3. Create another team named '∞'
  4. Request a scrimmage from someone

This is the error I get (it's an HTTP 400 response):

The "it returned 2" becomes "it returned 3" if I re-create my team with the same name, and 4 if I do it again.

Here's how I think it can be fixed (I have no Django experience so I got no idea how to code this):
When a team is deleted, team.deleted is set to True. When the ScrimmageSerializer is used to check whether the team names of the teams participating in the requested scrimmage are valid, it requests all Team objects and tries to match by name. Since there are now multiple teams with name "∞", this returns multiple results which is not allowed. I'm guessing this can be fixed by making sure the Team.objects.all() results are filtered to only include teams with deleted set to False.

@joshuagruenstein
Copy link
Contributor

@jsegaran @kelvin-lu @arvid220u can one of you look into this?

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

No branches or pull requests

2 participants