Skip to content
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

Settings file to declare what settings should be merged #2294

Merged
merged 5 commits into from
Mar 12, 2024
Merged

Conversation

mauromsl
Copy link
Member

@mauromsl mauromsl commented Jul 8, 2021

Instead of mandating what settting iterables should be merged from the
runtime, a user writing a custom settings module can declare a set of
MERGEABLE_SETTINGS

Closes #2284

Instead of mandating what settting iterables should be merged from the
runtime, a user writing a custom settings module can declare a set of
MERGEABLE_SETTINGS
Copy link
Contributor

@alexdutton alexdutton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me (just the one minor comment), and solves my problem. :-D

@@ -16,7 +16,7 @@

LOCK = threading.Lock()

MERGEABLE_SETTINGS = {"INSTALLED_APPS", "MIDDLEWARE_CLASSES"}
MERGEABLE_SETTINGS = {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't look to be used anymore?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We try to be extra defensive when removing public constants like this in case a plugin out there might be using them, so we keep them for at least one release cycle.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense :-). For full backwards-compatibility then, should this be unchanged, and be the default if it's not provided in custom_settings?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, though as {} it's now a dictionary and not a set as before :-)

@ajrbyers
Copy link
Member

test this please

@mauromsl mauromsl requested a review from ajrbyers March 12, 2024 08:29
@mauromsl mauromsl marked this pull request as ready for review March 12, 2024 08:30
@mauromsl mauromsl changed the base branch from master to b_1_5_2 March 12, 2024 08:30
@mauromsl mauromsl merged commit 88ba037 into b_1_5_2 Mar 12, 2024
1 check failed
@mauromsl mauromsl deleted the 2284-bugfix branch March 12, 2024 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Merging settings makes it almost impossible to fully override settings
3 participants