fix captcha

master
Fox Wilson 2015-11-12 15:47:30 -05:00
parent a65f2184a9
commit e9ca5e75f0
3 changed files with 8 additions and 5 deletions

2
app.py
View File

@ -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

View File

@ -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

View File

@ -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"]