From e3f1e01f888c85a7a4d32f63b61ae76a7ab2c640 Mon Sep 17 00:00:00 2001 From: wsxyt Date: Fri, 16 Jan 2026 01:45:10 +0800 Subject: [PATCH] =?UTF-8?q?`fix(roll=5Fcall):=20=E6=B8=85=E9=99=A4?= =?UTF-8?q?=E7=BC=93=E5=AD=98=E4=BB=A5=E7=A1=AE=E4=BF=9D=E4=B8=8B=E6=AC=A1?= =?UTF-8?q?=E6=8A=BD=E5=8F=96=E8=AF=BB=E5=8F=96=E6=9C=80=E6=96=B0=E8=AE=B0?= =?UTF-8?q?=E5=BD=95`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/roll_call/roll_call_utils.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/common/roll_call/roll_call_utils.py b/app/common/roll_call/roll_call_utils.py index 36e0f054..74a3a52d 100644 --- a/app/common/roll_call/roll_call_utils.py +++ b/app/common/roll_call/roll_call_utils.py @@ -504,6 +504,11 @@ def reset_drawn_records(window, class_name, gender_filter, group_filter): group_filter: 小组过滤器 """ reset_drawn_record(window, class_name, gender_filter, group_filter) + + # 清除缓存,确保下次抽取时重新读取记录 + record_key = f"{class_name}_{gender_filter}_{group_filter}" + if record_key in RollCallUtils._drawn_record_cache: + del RollCallUtils._drawn_record_cache[record_key] @staticmethod def update_start_button_state(button, total_count): @@ -637,6 +642,11 @@ def record_drawn_students( group=group_filter, student_name=selected_students, ) + + # 清除缓存,确保下次抽取时重新读取最新的已抽取记录 + record_key = f"{class_name}_{gender_filter}_{group_filter}" + if record_key in RollCallUtils._drawn_record_cache: + del RollCallUtils._drawn_record_cache[record_key] if selected_students_dict: save_roll_call_history(