NotRegistered: The model "Permission" is not registered for translation
See original GitHub issueAfter spending ~8hrs of time figuring out the problem, and after a nonsensical pull request, I can report I’ve found an issue:
I have a translated InheritedPermission
model inherited from django’s Permission
, on which I use some translated fields.
When accessing the Permission
with has_perm
from the user angle, modeltranslation explodes. Probable cause is the Permission.objects
manager gets replaced after expiring the relations cache, which can happen on various occasions (at my project it happens at initialization time).
I’ve created a test in my fork that reproduces the bug: see #466 and the latest failing commit.
@deschler, can we get a quick fix and a release? modeltranslation not being released for Django 2.x is the biggest blocker for me from changing to Django 2.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:7
- Comments:14 (1 by maintainers)
Top GitHub Comments
Looks like i fixed issue by making patched managers local to the translated model.
Will release beta3 soon.
@felixxm take a look anyway 😃 my fix is working, and did not break any tests, but maybe you have better idea.