mirror of
https://github.com/valitydev/redash.git
synced 2024-11-07 09:28:51 +00:00
Merge pull request #852 from hudl/ConfigurationFixes
Small fixes for new ConfigurationContainer use
This commit is contained in:
commit
db59b34bda
@ -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
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user