Skip to content

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

@jmerle

Description

@jmerle

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions