Add the soon-to-be-mandatory on_delete argument to ForeignKeys.
Review Request #9667 — Created Feb. 18, 2018 and submitted — Latest diff uploaded
ForeignKey
accepts anon_delete
argument that says that should
happen when the object on the other end of the relation is deleted.
Historically, Django has defaulted toCASCADE
, which deletes the
object on this end of the relation, but there are other options
available.In order to prevent unintentional deletions, Django 2.0 requires this
option, and Django 1.11 emits a deprecation warning if it's not set.
This change goes through allForeignKey
fields in Djblets and sets it
to the historical default ofCASCADE
.
Unit tests on Djblets and Review Board pass for Django 1.6.