Key submission now stored. Correct key submissions can be deleted.

This commit is contained in:
Sean Meyer
2015-05-19 13:52:15 +08:00
parent f660a760e6
commit 18ddd1eeec
4 changed files with 66 additions and 8 deletions

View File

@@ -99,7 +99,7 @@ def init_challenges(app):
for x in keys:
if x.key_type == 0: #static key
if x.flag.strip().lower() == key:
solve = Solves(chalid=chalid, teamid=session['id'], ip=request.remote_addr)
solve = Solves(chalid=chalid, teamid=session['id'], ip=request.remote_addr, flag=key)
db.session.add(solve)
db.session.commit()
db.session.close()
@@ -108,7 +108,7 @@ def init_challenges(app):
elif x.key_type == 1: #regex
res = re.match(str(x), key, re.IGNORECASE)
if res and res.group() == key:
solve = Solves(chalid=chalid, teamid=session['id'], ip=request.remote_addr)
solve = Solves(chalid=chalid, teamid=session['id'], ip=request.remote_addr, flag=key)
db.session.add(solve)
db.session.commit()
db.session.close()