This repository was archived by the owner on Mar 26, 2025. It is now read-only.
fix: Delay importing models.CMSPlugin in utils.#637
Merged
fsbraun merged 3 commits intodjango-cms:masterfrom Nov 30, 2022
Merged
fix: Delay importing models.CMSPlugin in utils.#637fsbraun merged 3 commits intodjango-cms:masterfrom
fsbraun merged 3 commits intodjango-cms:masterfrom
Conversation
…ctions, this allows adding an HTMLField into a custom user model
Codecov Report
@@ Coverage Diff @@
## master #637 +/- ##
==========================================
+ Coverage 69.86% 69.93% +0.06%
==========================================
Files 16 16
Lines 448 449 +1
Branches 49 49
==========================================
+ Hits 313 314 +1
Misses 118 118
Partials 17 17
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Member
|
Some of the test fail due to migrations of other packages. This is fixed in #631. So do not worry about that. Can you fix the isort issue (see linting results)? I'll merge then. Thanks very much!! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Continuation of PR #636
As mentioned in #468, Importing
html.clean_htmltoo early prevents registering custom user models containing anHTMLField.This solves the issue by decoupling the import of
models.CMSPlugininto the relevant function calls, to allow registering the models properly.NOTE: This lacks a proper test, as I couldn't manage to register a custom user model and define it in
settings.AUTH_USER_MODELusing django-cms's app_helper mechanism. If you absolutely need a test, can you please provide guidance on how to define a custom user model, that would trigger the error (when 172e1f0348415fa80ce4b622c34587460e162afd is not present)?