Skip to content

171 fix ObjectChange for update not showing on restart #178

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

arthanson
Copy link
Contributor

@arthanson arthanson commented Aug 22, 2025

Fixes: #171

The root issue is get_models wasn't returning the dynamically created CO models on startup. However putting this in causes a recursion error when you go to create a new COT - as the type() call in get_model if you are creating a new object calls into get_models, which calls get_model (recursion).

Where this happens is in the clear_cache routine as it clears the apps cache and then reloads all the models from get_models. So this monkey-patches the clear_cache code to do a no-op until the type is actually created, then once the model is added to the cache it calls clear_cache which is safe to call now as get_models->get_model will just return the cached model thus avoiding the infinite recursion.

@arthanson arthanson requested a review from bctiemann August 22, 2025 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

django.core.exceptions.ImproperlyConfigured with COT which points to another COT
1 participant