mirror of
https://github.com/jazzband/django-configurations.git
synced 2026-03-16 22:20:27 +00:00
Stop copying parent attributes into child class
This avoids breaking the normal MRO for attributes, which searches the class hierarchy for attribute definitions. If attributes are copied onto every class in the hierarchy, the C3 MRO algorithm finds the attribute in a child class even though that class didn't actually define it, which results in surprising attribute values when classes in the hierarchy set the same attribute to different values.
This commit is contained in:
parent
cad6dcb7f0
commit
9e8b0137d0
1 changed files with 0 additions and 6 deletions
|
|
@ -26,12 +26,6 @@ class ConfigurationBase(type):
|
|||
if not importer.installed:
|
||||
raise ImproperlyConfigured(install_failure)
|
||||
settings_vars = uppercase_attributes(global_settings)
|
||||
parents = [base for base in bases if isinstance(base,
|
||||
ConfigurationBase)]
|
||||
if parents:
|
||||
for base in bases[::-1]:
|
||||
settings_vars.update(uppercase_attributes(base))
|
||||
|
||||
deprecated_settings = {
|
||||
# DEFAULT_HASHING_ALGORITHM is always deprecated, as it's a
|
||||
# transitional setting
|
||||
|
|
|
|||
Loading…
Reference in a new issue