Skip to content

Commit

Permalink
pylint
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason Davis committed Aug 4, 2020
1 parent 7caf863 commit 514fff8
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions superset/tasks/schedules.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"""Utility functions used across Superset"""

import logging
import textwrap
import time
import urllib.request
from collections import namedtuple
Expand Down Expand Up @@ -573,8 +572,6 @@ def deliver_alert(alert: Alert, recipients: Optional[str] = None) -> None:
images = {}
recipients = recipients or alert.recipients

alert_url = get_url_path("AlertModelView.show", pk=alert.id)

if alert.slice:

chart_url = get_url_path(
Expand All @@ -588,6 +585,7 @@ def deliver_alert(alert: Alert, recipients: Optional[str] = None) -> None:
standalone_index = chart_url.find("/?standalone=true")
if standalone_index != -1:
image_url = chart_url[:standalone_index]

user = security_manager.find_user(current_app.config["THUMBNAIL_SELENIUM_USER"])
img_data = screenshot.compute_and_cache(
user=user, cache=thumbnail_cache, force=True,
Expand All @@ -604,7 +602,7 @@ def deliver_alert(alert: Alert, recipients: Optional[str] = None) -> None:
images = {"screenshot": img_data}
body = render_template(
"email/alert.txt",
alert_url=alert_url,
alert_url=get_url_path("AlertModelView.show", pk=alert.id),
label=alert.label,
sql=alert.sql,
image_url=image_url,
Expand Down

0 comments on commit 514fff8

Please sign in to comment.