Refactor conditional to pass required setting tests.

If a setting is defined in a subclass and is not None do not raise
config error.
This commit is contained in:
Facetoe 2016-08-09 18:20:40 +08:00
parent 86fddf8e22
commit c30365338b

View File

@ -33,8 +33,10 @@ class SettingsBaseMeta(type):
# required anymore.
for base in inspect.getmro(cls):
for r in list(required):
if hasattr(base, r) and getattr(base, r) != getattr(cls, r):
if hasattr(base, r) and getattr(base, r) != getattr(cls, r) \
or hasattr(cls, r) and getattr(cls, r) is not None:
required.remove(r)
return unique(settings), required