flake8
-
reviewboard/changedescs/models.py (Diff revision 1) Show all issues
Review Request #11988 — Created Jan. 24, 2022 and submitted
Information | |
---|---|
david | |
Review Board | |
master | |
Reviewers | |
reviewboard | |
Django has made the
on_delete
argument toForeignKey
mandatory.
Until now, this has defaulted toCASCADE
, which makes it easy to
unintentionally delete things that shouldn't be deleted. Making it a
required argument forces developers to think about each model and how it
should behave.This change explicitly sets
on_delete
for every relation we have. Most
of these areCASCADE
, but the diff data ones areSET_NULL
because
those are effectively a one-to-many relation, and we don't want to
delete diff data that may be shared by other diffs.
Ran unit tests.
Commits: |
|
|||||||||
---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 2 (+386 -224) |
Description: |
|
||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Commits: |
|
||||||||||||||||||||||||||||||
Diff: |
Revision 3 (+390 -224) |