Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ref(backup): Remove ManyToMany dependencies (#54480)
The `sorted_dependencies` function has, since time immemorial, tried to track all `ManyToManyField` dependencies without a `through` model set, since there is otherwise no way to deduce the dependency relationship for the shadow junction tables Django creates under the hood. Except... we actually don't have any `ManyToManyField` definitions without an explicit `through` argument. Maybe we did when this code was written, but today we no longer do. The removed bits of code were thus never really executed, since they were checking for a state of affairs that wasn't really a problem in our actual code base. They were also buggy: the comment said they were checking for `through`-ness, but there was no code to this effect, resulting in double dependencies. This change removes the check altogether, and adds an invariant test to ensure that all `ManyToManyField`s defined in the future carry a `through` argument. Issue: getsentry/team-ospo#171
- Loading branch information