From 2e00227dcdf7d04718e95b10ea3860507f3031c6 Mon Sep 17 00:00:00 2001 From: Matthew Grove Date: Sun, 15 Feb 2026 17:30:03 +0000 Subject: [PATCH] Attribute failed guess to first challenge in category to avoid team page rendering issues --- __init__.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/__init__.py b/__init__.py index 9aaae6d..f5afa10 100644 --- a/__init__.py +++ b/__init__.py @@ -95,11 +95,12 @@ def load(app): except Exception: continue # 6. No Match: Log exactly one incorrect attempt globally - db.session.add(Submissions( - user_id=user.id, team_id=team.id if team else None, - challenge_id=None, ip=request.remote_addr, provided=provided, type='incorrect' - )) - db.session.commit() + if (len(challenges) > 0): + db.session.add(Submissions( + user_id=user.id, team_id=team.id if team else None, + challenge_id=challenges[0].id, ip=request.remote_addr, provided=provided, type='incorrect' + )) + db.session.commit() return jsonify({'success': False, 'message': 'Incorrect Flag'}) app.register_blueprint(plugin_bp)