1
0
Fork 0

app/main.py: flash a message after deleting a word (use bootstrap alerts).

Lanhui-flash-messages
Hui Lan 2021-08-02 19:11:53 +08:00
parent 4773a6d131
commit 08bb7e0c40
1 changed files with 5 additions and 5 deletions

View File

@ -194,12 +194,12 @@ def get_answer_part(s):
def get_flashed_messages_if_any(): def get_flashed_messages_if_any():
messages = get_flashed_messages() messages = get_flashed_messages()
if messages == []: s = ''
return ''
s = '<ul class=flashes>'
for message in messages: for message in messages:
s += f'<li>{message}</li>' s += '<div class="alert alert-warning" role="alert">'
return s + '</ul>' s += f'{message}'
s += '</div>'
return s
@app.route("/<username>/reset", methods=['GET', 'POST']) @app.route("/<username>/reset", methods=['GET', 'POST'])