From 0b202722e6859a6cea540b74e16fb6227f60f6bf Mon Sep 17 00:00:00 2001 From: XingQue Date: Fri, 26 Jun 2026 14:41:03 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=80=83=E8=AF=95bundle=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E6=8F=90=E7=A4=BA=E5=8C=BA=E5=88=86=E6=9C=AA=E4=B8=8A?= =?UTF-8?q?=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jituan/services/dashou_exam.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jituan/services/dashou_exam.py b/jituan/services/dashou_exam.py index 78f67a3..22e563f 100644 --- a/jituan/services/dashou_exam.py +++ b/jituan/services/dashou_exam.py @@ -210,7 +210,10 @@ def build_exam_bundle(request, user): all_ids = list(qs.values_list('id', flat=True)) draw = min(int(cfg.draw_count or 10), len(all_ids)) if draw < 1: - return None, '题库暂无可用题目,请联系管理员' + total = ClubDashouExamQuestion.query.filter(club_id=club_id).count() + if total > 0 and not all_ids: + return None, '题库有题目但未上架,请在后台打开题目的「上架」开关' + return None, '题库暂无已上架题目,请至少录入一道题并上架(每题至少两个选项且标记正确答案)' selected_ids = random.sample(all_ids, draw) questions = []