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
|
except Exception: continue
|
||||||
|
|
||||||
# 6. No Match: Log exactly one incorrect attempt globally
|
# 6. No Match: Log exactly one incorrect attempt globally
|
||||||
db.session.add(Submissions(
|
if (len(challenges) > 0):
|
||||||
user_id=user.id, team_id=team.id if team else None,
|
db.session.add(Submissions(
|
||||||
challenge_id=None, ip=request.remote_addr, provided=provided, type='incorrect'
|
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()
|
))
|
||||||
|
db.session.commit()
|
||||||
return jsonify({'success': False, 'message': 'Incorrect Flag'})
|
return jsonify({'success': False, 'message': 'Incorrect Flag'})
|
||||||
|
|
||||||
app.register_blueprint(plugin_bp)
|
app.register_blueprint(plugin_bp)
|
||||||
|
|||||||
Reference in New Issue
Block a user