Skip to content

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.

Also needed to return the generated through models in get_models

bctiemann and others added 23 commits August 18, 2025 14:17
Check if unique flag raise validation error if non unique data
NPL-411 raise validation error if using reserved names for fields
Revert "Check if unique flag raise validation error if non unique data"
174 fix delete of CO on detail page
Bump version to 0.2.0 in pyproject.toml
@arthanson arthanson requested a review from bctiemann August 22, 2025 20:32
@arthanson arthanson marked this pull request as ready for review August 27, 2025 15:37
@arthanson arthanson marked this pull request as draft August 29, 2025 21:01
@arthanson arthanson changed the base branch from main to feature August 29, 2025 21:02
@arthanson arthanson marked this pull request as ready for review September 2, 2025 18:14
@arthanson arthanson merged commit 2dd8d17 into feature Sep 2, 2025
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
3 participants