1
0
Fork 0
Bug493-GongKeCheng
田其鹭 2023-05-14 21:10:19 +08:00
parent 0549bd9035
commit a5c792b782
2 changed files with 9 additions and 10 deletions

View File

@ -37,16 +37,16 @@
<body>
<div class="container-fluid">
<p><b>English Pal for <font id="username" color="red">{{ username }}</font></b>
<<<<<<< HEAD
<a class="btn btn-secondary" href="/logout" role="button">退出</a>
<a class="btn btn-secondary" href="/reset" role="button">重设密码</a>
</p>
{% if flashed_messages != "" %}
<div class="alert alert-warning" role="alert" id="warn_info">{{ flashed_messages|safe }}</div>
{% if flashed_messages != [] %}
<div class="alert alert-warning" role="alert" id="warn_info">
{{ flashed_messages|safe }}
</div>
{% endif %}
=======
>>>>>>> d9f6df7fbe585395a19b9a08c411d841b6b89fd4
{% if username == admin_name %}
<a class="btn btn-secondary" href="/admin" role="button" onclick="stopRead()">管理</a>

View File

@ -102,8 +102,7 @@ def deleteword(username, word):
'''
user_freq_record = path_prefix + 'static/frequency/' + 'frequency_%s.pickle' % (username)
pickle_idea2.deleteRecord(user_freq_record, word)
# 模板userpage_get.html中删除单词是异步执行而flash的信息后续是同步执行的所以注释这段代码同时如果这里使用flash但不提取信息则会影响 signup.html的显示。bug复现删除单词后点击退出点击注册注册页面就会出现提示信息
# flash(f'{word} is no longer in your word list.')
flash(f'{word} is no longer in your word list.')
return "success"
@ -151,7 +150,7 @@ def userpage(username):
admin_name=ADMIN_NAME,
username=username,
session=session,
# flashed_messages=get_flashed_messages(), 仅有删除单词的时候使用到flash而删除单词是异步执行这里的信息提示是同步执行所以就没有存在的必要了
flashed_messages=get_flashed_messages(),
today_article=today_article,
result_of_generate_article=result_of_generate_article,
d_len=len(d),
@ -193,7 +192,7 @@ def get_flashed_messages_if_any():
在用户界面显示黄色提示信息
:return: 包含HTML标签的提示信息
'''
messages = get_flashed_messages()
messages = get_flashed_messages
s = ''
for message in messages:
s += message