Merge pull request #852 from hudl/ConfigurationFixes

Small fixes for new ConfigurationContainer use
This commit is contained in:
Arik Fraimovich 2016-02-24 21:49:57 +02:00
commit db59b34bda
2 changed files with 4 additions and 2 deletions

View File

@ -15,7 +15,7 @@ from flask.ext.login import UserMixin, AnonymousUserMixin
from permissions import has_access, view_only
from redash import utils, settings, redis_connection
from redash.query_runner import get_query_runner
from redash.query_runner import get_query_runner, get_configuration_schema_for_type
from redash.metrics.database import MeteredPostgresqlExtDatabase, MeteredModel
from redash.utils import generate_token
from redash.utils.configuration import ConfigurationContainer
@ -350,6 +350,8 @@ class DataSource(BelongsToOrgMixin, BaseModel):
}
if all:
schema = get_configuration_schema_for_type(self.type)
self.options.set_schema(schema)
d['options'] = self.options.to_dict(mask_secrets=True)
d['queue_name'] = self.queue_name
d['scheduled_queue_name'] = self.scheduled_queue_name

View File

@ -38,7 +38,7 @@ class ConfigurationContainer(object):
return self._config.iteritems()
def to_dict(self, mask_secrets=False):
if mask_secrets is False:
if (mask_secrets is False or 'secret' not in self.schema):
return self._config
config = self._config.copy()