fix: Don't allow alerts without an ID to be dismissed
All checks were successful
Build Docker / Build Images (map[dockerfile:Dockerfile tag_suffix: target:default]) (push) Successful in 2m58s
Tests and Linting / Tests-Linting (3.13) (push) Successful in 3m4s
Tests and Linting / Tests-Linting (3.11) (push) Successful in 3m6s
Tests and Linting / Tests-Linting (3.10) (push) Successful in 3m10s
Build Docker / Build Images (map[dockerfile:Dockerfile.hsd tag_suffix:-hsd target:hsd]) (push) Successful in 11m1s
All checks were successful
Build Docker / Build Images (map[dockerfile:Dockerfile tag_suffix: target:default]) (push) Successful in 2m58s
Tests and Linting / Tests-Linting (3.13) (push) Successful in 3m4s
Tests and Linting / Tests-Linting (3.11) (push) Successful in 3m6s
Tests and Linting / Tests-Linting (3.10) (push) Successful in 3m10s
Build Docker / Build Images (map[dockerfile:Dockerfile.hsd tag_suffix:-hsd target:hsd]) (push) Successful in 11m1s
This commit is contained in:
7
main.py
7
main.py
@@ -74,8 +74,9 @@ def index():
|
|||||||
alerts = get_alerts(account)
|
alerts = get_alerts(account)
|
||||||
for alert in alerts:
|
for alert in alerts:
|
||||||
output_html = alert['output']
|
output_html = alert['output']
|
||||||
# Add a dismiss button
|
if 'id' in alert:
|
||||||
output_html += f" <a href='/dismiss/{alert['id']}' class='btn btn-secondary btn-sm' style='margin:none;'>Dismiss</a>"
|
# Add a dismiss button
|
||||||
|
output_html += f" <a href='/dismiss/{alert['id']}' class='btn btn-secondary btn-sm' style='margin:none;'>Dismiss</a>"
|
||||||
plugins += render_template('components/dashboard-alert.html', name=alert['name'], output=output_html)
|
plugins += render_template('components/dashboard-alert.html', name=alert['name'], output=output_html)
|
||||||
|
|
||||||
return render_template("index.html", account=account, plugins=plugins)
|
return render_template("index.html", account=account, plugins=plugins)
|
||||||
@@ -1920,7 +1921,7 @@ def get_alerts(account:str) -> list:
|
|||||||
logger.info("New version available")
|
logger.info("New version available")
|
||||||
alerts.append({
|
alerts.append({
|
||||||
"name": "Update Available",
|
"name": "Update Available",
|
||||||
"output": f"A new version of FireWallet is available. <a href='https://git.woodburn.au/nathanwoodburn/firewalletbrowser/compare/{commit}...{branch}' target='_blank'>Changelog</a>."
|
"output": f"A new version of FireWallet is available. <a href='https://git.woodburn.au/nathanwoodburn/firewalletbrowser/compare/{commit}...{branch}' target='_blank'>Changelog</a>"
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user