Attribute failed guess to first challenge in category to avoid team page rendering issues
This commit is contained in:
11
__init__.py
11
__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)
|
||||
|
||||
Reference in New Issue
Block a user