Skip to content

Commit

Permalink
Do not force screenshot on dashboard alerts
Browse files Browse the repository at this point in the history
  • Loading branch information
betodealmeida committed Dec 22, 2021
1 parent 7d59d29 commit ad52455
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ const AlertReportModal: FunctionComponent<AlertReportModalProps> = ({
const data: any = {
...currentAlert,
type: isReport ? 'Report' : 'Alert',
force_screenshot: isReport ? 'false' : 'true',
force_screenshot: contentType === 'chart' && !isReport ? 'true' : 'false',
validator_type: conditionNotNull ? 'not null' : 'operator',
validator_config_json: conditionNotNull
? {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ def upgrade():
session = db.Session(bind=bind)

for report in session.query(ReportSchedule).all():
report.force_screenshot = report.type == "Alert"
# Update existing alerts that send chart screenshots so that the cache is
# bypassed. We don't turn this one for dashboards because (1) it's currently
# not supported but also because (2) it can be very expensive.
report.force_screenshot = report.type == "Alert" and report.chart_id is not None

session.commit()

Expand Down

0 comments on commit ad52455

Please sign in to comment.