Strengthen attribute check for Tower configuration validations

This commit is contained in:
Aaron Tan
2017-07-07 11:44:56 -04:00
parent 9a4701fe30
commit 0138510936
3 changed files with 8 additions and 2 deletions

View File

@@ -446,7 +446,9 @@ register(
def logging_validate(serializer, attrs):
if not serializer.instance:
if not serializer.instance or \
not hasattr(serializer.instance, 'LOG_AGGREGATOR_HOST') or \
not hasattr(serializer.instance, 'LOG_AGGREGATOR_TYPE'):
return attrs
errors = []
if attrs.get('LOG_AGGREGATOR_ENABLED', False):