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",
|
||||
"version": "0.11.0",
|
||||
"version": "0.11.1",
|
||||
"dependencies": {
|
||||
"angular": "1.2.18",
|
||||
"angular-resource": "1.2.18",
|
||||
|
||||
@@ -12,17 +12,16 @@ dependencies:
|
||||
- pip install -r requirements_dev.txt
|
||||
- pip install -r requirements.txt
|
||||
- pip install pymongo==3.2.1
|
||||
- if [ "$CIRCLE_BRANCH" = "master" ]; then make deps; fi
|
||||
- make deps
|
||||
cache_directories:
|
||||
- node_modules/
|
||||
- rd_ui/node_modules/
|
||||
- rd_ui/app/bower_components/
|
||||
test:
|
||||
override:
|
||||
- nosetests --with-xunit --xunit-file=$CIRCLE_TEST_REPORTS/junit.xml --with-coverage --cover-package=redash tests/
|
||||
deployment:
|
||||
github_and_docker:
|
||||
branch: master
|
||||
branch: [master, /release_.*/]
|
||||
commands:
|
||||
- make pack
|
||||
- make upload
|
||||
|
||||
@@ -13,7 +13,7 @@ from redash.query_runner import import_query_runners
|
||||
from redash.destinations import import_destinations
|
||||
|
||||
|
||||
__version__ = '0.11.0'
|
||||
__version__ = '0.11.1'
|
||||
|
||||
|
||||
if settings.FEATURE_TABLES_PERMISSIONS:
|
||||
|
||||
@@ -24,7 +24,11 @@ class Email(BaseDestination):
|
||||
return 'fa-envelope'
|
||||
|
||||
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 = """
|
||||
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)
|
||||
@@ -39,6 +43,6 @@ class Email(BaseDestination):
|
||||
)
|
||||
mail.send(message)
|
||||
except Exception:
|
||||
logging.exception("mail send ERROR.")
|
||||
logging.exception("Mail send error.")
|
||||
|
||||
register(Email)
|
||||
|
||||
@@ -1189,12 +1189,11 @@ class AlertSubscription(ModelTimestampsMixin, BaseModel):
|
||||
app, host)
|
||||
else:
|
||||
# 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')
|
||||
options = ConfigurationContainer(json.dumps(config), schema)
|
||||
options = ConfigurationContainer(config, schema)
|
||||
destination = get_destination('email', options)
|
||||
return destination.notify(alert, query, user, new_state,
|
||||
app, host, options)
|
||||
return destination.notify(alert, query, user, new_state, app, host, options)
|
||||
|
||||
|
||||
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:
|
||||
subscription.notify(alert, query, subscription.user, new_state, app, host)
|
||||
except Exception as e:
|
||||
logger.warn("Exception: {}".format(e))
|
||||
logger.exception("Error with processing destination")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user