RuntimeError: Unable to resolve relationship `user` for `wagtailcore.ModelLogEntry`. Django is most likely not initialized, and its apps registry not populated. Ensure Django has finished setup before loading `FilterSet`s
See original GitHub issueHi!
I’ve updated to the LTS 4.1 but this error came out:
RuntimeError: Unable to resolve relationship `user` for `wagtailcore.ModelLogEntry`. Django is most likely not initialized, and its apps registry not populated. Ensure Django has finished setup before loading `FilterSet`s.
I have the following versions:
Wagtail 4.1 Django 4.0.8 django-filter 22.1]
My temporal “fix”
I was able to solve this by removing the user on the meta class of SnippetHistoryReportFilterSet :
class Meta:
model = ModelLogEntry
fields = ["action", "**_user_**", "timestamp"]
This is located at wagtail/snippets/views/snippets.py
Is that a logger or something like that? If so, is there a way to disable it in order to use the page?
Thanks!
Issue Analytics
- State:
- Created a year ago
- Comments:12 (3 by maintainers)
Top Results From Across the Web
Fix issue with snippets and custom user model related to ...
ModelLogEntry `. Django is most likely not initialized, and its apps registry not populated. Ensure Django has finished setup before loading `FilterSet`s.
Read more >Django stops working with RuntimeError: populate() isn't ...
This is caused by a bug in your Django settings somewhere. Unfortunately, Django's hiding the bug behind this generic and un-useful error message....
Read more >21875 (Runtime Error with Django-Tastypie: "App registry isn't ...
Goes away when I remove django-tastypie as installed app. Traceback (most recent call last): File "manage.py", line 10, in <module> execute_from_command_line( ...
Read more >populate isn't reentrant - Google Groups
Ideally Django would in the case of seeing an exception while loading applications not leave the registry in an inconsistent state and cleanup...
Read more >Relationships in Django models - Web Forefront
How to declare Django model relationships one to many, many to many and one to one; what are a Django models relationship options....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Reopening this, as we do want to find a proper fix for this that allows previously-working code to continue working on 4.1.
@ababic That sounds like a good plan, yep! We’re being a bit quirky with how we mix model and view code here, and while I think django-filter might be technically in the wrong for how early in the execution it’s doing model lookups, making it less quirky wouldn’t be a bad thing. 😃