mirror of
https://github.com/getredash/redash.git
synced 2025-12-20 09:57:35 -05:00
Compare commits
5 Commits
query-base
...
v0.11.1.b2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
14ea79b1e9 | ||
|
|
432fe9b8a3 | ||
|
|
33909a1b32 | ||
|
|
9bca3933e7 | ||
|
|
e1dd1b3f71 |
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "redash",
|
"name": "redash",
|
||||||
"version": "0.11.0",
|
"version": "0.11.1",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"angular": "1.2.18",
|
"angular": "1.2.18",
|
||||||
"angular-resource": "1.2.18",
|
"angular-resource": "1.2.18",
|
||||||
|
|||||||
@@ -12,17 +12,16 @@ dependencies:
|
|||||||
- pip install -r requirements_dev.txt
|
- pip install -r requirements_dev.txt
|
||||||
- pip install -r requirements.txt
|
- pip install -r requirements.txt
|
||||||
- pip install pymongo==3.2.1
|
- pip install pymongo==3.2.1
|
||||||
- if [ "$CIRCLE_BRANCH" = "master" ]; then make deps; fi
|
- make deps
|
||||||
cache_directories:
|
cache_directories:
|
||||||
- node_modules/
|
- node_modules/
|
||||||
- rd_ui/node_modules/
|
|
||||||
- rd_ui/app/bower_components/
|
- rd_ui/app/bower_components/
|
||||||
test:
|
test:
|
||||||
override:
|
override:
|
||||||
- nosetests --with-xunit --xunit-file=$CIRCLE_TEST_REPORTS/junit.xml --with-coverage --cover-package=redash tests/
|
- nosetests --with-xunit --xunit-file=$CIRCLE_TEST_REPORTS/junit.xml --with-coverage --cover-package=redash tests/
|
||||||
deployment:
|
deployment:
|
||||||
github_and_docker:
|
github_and_docker:
|
||||||
branch: master
|
branch: [master, /release_.*/]
|
||||||
commands:
|
commands:
|
||||||
- make pack
|
- make pack
|
||||||
- make upload
|
- make upload
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ from redash.query_runner import import_query_runners
|
|||||||
from redash.destinations import import_destinations
|
from redash.destinations import import_destinations
|
||||||
|
|
||||||
|
|
||||||
__version__ = '0.11.0'
|
__version__ = '0.11.1'
|
||||||
|
|
||||||
|
|
||||||
if settings.FEATURE_TABLES_PERMISSIONS:
|
if settings.FEATURE_TABLES_PERMISSIONS:
|
||||||
|
|||||||
@@ -24,7 +24,11 @@ class Email(BaseDestination):
|
|||||||
return 'fa-envelope'
|
return 'fa-envelope'
|
||||||
|
|
||||||
def notify(self, alert, query, user, new_state, app, host, options):
|
def notify(self, alert, query, user, new_state, app, host, options):
|
||||||
recipients = [email for email in options.get('addresses').split(',') if email]
|
recipients = [email for email in options.get('addresses', '').split(',') if email]
|
||||||
|
|
||||||
|
if not recipients:
|
||||||
|
logging.warning("No emails given. Skipping send.")
|
||||||
|
|
||||||
html = """
|
html = """
|
||||||
Check <a href="{host}/alerts/{alert_id}">alert</a> / check <a href="{host}/queries/{query_id}">query</a>.
|
Check <a href="{host}/alerts/{alert_id}">alert</a> / check <a href="{host}/queries/{query_id}">query</a>.
|
||||||
""".format(host=host, alert_id=alert.id, query_id=query.id)
|
""".format(host=host, alert_id=alert.id, query_id=query.id)
|
||||||
@@ -39,6 +43,6 @@ class Email(BaseDestination):
|
|||||||
)
|
)
|
||||||
mail.send(message)
|
mail.send(message)
|
||||||
except Exception:
|
except Exception:
|
||||||
logging.exception("mail send ERROR.")
|
logging.exception("Mail send error.")
|
||||||
|
|
||||||
register(Email)
|
register(Email)
|
||||||
|
|||||||
@@ -1189,12 +1189,11 @@ class AlertSubscription(ModelTimestampsMixin, BaseModel):
|
|||||||
app, host)
|
app, host)
|
||||||
else:
|
else:
|
||||||
# User email subscription, so create an email destination object
|
# User email subscription, so create an email destination object
|
||||||
config = {'email': self.user.email}
|
config = {'addresses': self.user.email}
|
||||||
schema = get_configuration_schema_for_destination_type('email')
|
schema = get_configuration_schema_for_destination_type('email')
|
||||||
options = ConfigurationContainer(json.dumps(config), schema)
|
options = ConfigurationContainer(config, schema)
|
||||||
destination = get_destination('email', options)
|
destination = get_destination('email', options)
|
||||||
return destination.notify(alert, query, user, new_state,
|
return destination.notify(alert, query, user, new_state, app, host, options)
|
||||||
app, host, options)
|
|
||||||
|
|
||||||
|
|
||||||
all_models = (Organization, Group, DataSource, DataSourceGroup, User, QueryResult, Query, Alert, Dashboard, Visualization, Widget, Event, NotificationDestination, AlertSubscription, ApiKey)
|
all_models = (Organization, Group, DataSource, DataSourceGroup, User, QueryResult, Query, Alert, Dashboard, Visualization, Widget, Event, NotificationDestination, AlertSubscription, ApiKey)
|
||||||
|
|||||||
@@ -42,5 +42,5 @@ def check_alerts_for_query(query_id):
|
|||||||
try:
|
try:
|
||||||
subscription.notify(alert, query, subscription.user, new_state, app, host)
|
subscription.notify(alert, query, subscription.user, new_state, app, host)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.warn("Exception: {}".format(e))
|
logger.exception("Error with processing destination")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user