#26936: Stale content type deletion stops working if all models in an app are
deleted
------------------------------------------------+------------------------
Reporter: bmispelon | Owner: nobody
Type: Bug | Status: new
Component: contrib.contenttypes | Version: 1.9
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+------------------------
Steps to reproduce:
1) Create an app with one model in its `models.py`
2) Add it to `settings.INSTALLED_APPS`, run `makemakigrations`, and
`migrate`
3) Delete the model from `models.py`, run `makemigrations`, then `migrate`
At step 3), Django deletes the model from the database (as expected) but
doesn't prompt the user to delete the now stale content type (as normally
happens when you run `migrate`).
I believe this is called by the `if not app_config.models_module: return`
statement in `update_contenttypes()` [1]
[1]
https://github.com/django/django/blob/master/django/contrib/contenttypes/management.py#L95-L96
--
Ticket URL: <https://code.djangoproject.com/ticket/26936>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/052.0c07620e704028a773fa6d9b59fb99c0%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.