Skip to content
Commit 86e761fe authored by Diederik van der Boor's avatar Diederik van der Boor
Browse files

Fix NoneType error when fetching a stale ContentType with get_for_id

When a stale ContentType is fetched, the _add_to_cache() function
didn't detect that `model_class()` returns `None` (which it does by
design). However, the `app_label` + `model` fields can be used instead
to as local cache key. Third party apps can detect stale models by
checking whether `model_class()` returns `None`.

Ticket: https://code.djangoproject.com/ticket/20442
parent 96cabba8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment