fix duplicate broadcast message issue
This commit is contained in:
parent
dd1d9cff2b
commit
4dadab60d8
@ -15,6 +15,7 @@ from flask import render_template
|
|||||||
from flask import url_for
|
from flask import url_for
|
||||||
from flask import current_app
|
from flask import current_app
|
||||||
from flask import flash
|
from flask import flash
|
||||||
|
from flask import session
|
||||||
from apscheduler.schedulers.background import BackgroundScheduler
|
from apscheduler.schedulers.background import BackgroundScheduler
|
||||||
|
|
||||||
|
|
||||||
@ -210,6 +211,10 @@ def security_headers(response):
|
|||||||
response.headers['X-Content-Type-Options'] = 'nosniff'
|
response.headers['X-Content-Type-Options'] = 'nosniff'
|
||||||
|
|
||||||
if current_app.config['BROADCAST_BANNER_MESSAGE'] is not None and current_app.config['BROADCAST_BANNER_MESSAGE'] != "":
|
if current_app.config['BROADCAST_BANNER_MESSAGE'] is not None and current_app.config['BROADCAST_BANNER_MESSAGE'] != "":
|
||||||
|
for t in session.get("_flashes", []):
|
||||||
|
if t is not None and t[1] == current_app.config['BROADCAST_BANNER_MESSAGE']:
|
||||||
|
return response
|
||||||
|
|
||||||
flash(current_app.config['BROADCAST_BANNER_MESSAGE'])
|
flash(current_app.config['BROADCAST_BANNER_MESSAGE'])
|
||||||
|
|
||||||
return response
|
return response
|
||||||
|
Loading…
Reference in New Issue
Block a user