fix captcha
parent
a65f2184a9
commit
e9ca5e75f0
2
app.py
2
app.py
|
@ -6,7 +6,7 @@ from database import Team, TeamAccess, Challenge, ChallengeSolve, ChallengeFailu
|
|||
from datetime import datetime
|
||||
from peewee import fn
|
||||
|
||||
from utils import decorators, flag, cache, misc, captcha
|
||||
from utils import decorators, flag, cache, misc, captcha, email
|
||||
import utils.scoreboard
|
||||
|
||||
import config
|
||||
|
|
8
ctftool
8
ctftool
|
@ -41,8 +41,10 @@ elif operation == "gen-team":
|
|||
t.key = "autogen{}".format(t.id)
|
||||
t.save()
|
||||
print("Team added with id {}".format(t.id))
|
||||
for i in random.sample(chals, 5):
|
||||
ChallengeSolve.create(team=t, challenge=i, time=ctz)
|
||||
ctz = ctz + (diff * random.randint(-10, 10))
|
||||
|
||||
for i in range(n * 10):
|
||||
chal = random.choice(chals)
|
||||
ctz -= diff
|
||||
ChallengeSolve.create(team=Team.get(Team.id == (i % n) + 1), challenge=chal, time=ctz)
|
||||
|
||||
# vim: syntax=python:ft=python
|
||||
|
|
|
@ -3,9 +3,10 @@ from flask import request
|
|||
from . import misc
|
||||
|
||||
import config
|
||||
import requests
|
||||
|
||||
def verify_captcha():
|
||||
if "g-captcha-response" not in request.form:
|
||||
if "g-recaptcha-response" not in request.form:
|
||||
return CAPTCHA_NOT_COMPLETED
|
||||
|
||||
captcha_response = request.form["g-recaptcha-response"]
|
||||
|
|
Loading…
Reference in New Issue