Merge pull request #6 from takeshixx/upstream-fixes

Missing dependencies added, some weird imports fixed
selenium-screenshot-testing
Kevin Chung 2015-01-02 18:48:40 -05:00
commit 7cf762a6c4
8 changed files with 19 additions and 22 deletions

View File

@ -28,6 +28,7 @@ def create_app(subdomain, username="", password=""):
app.db = db app.db = db
# app.setup = True # app.setup = True
global mail
mail = Mail(app) mail = Mail(app)
Session(app) Session(app)

View File

@ -1,4 +1,4 @@
from CTFd import render_template, request, redirect, abort, jsonify, url_for, session from flask import render_template, request, redirect, abort, jsonify, url_for, session
from CTFd.utils import sha512, is_safe_url, authed, admins_only, is_admin, unix_time, unix_time_millis from CTFd.utils import sha512, is_safe_url, authed, admins_only, is_admin, unix_time, unix_time_millis
from CTFd.models import db, Teams, Solves, Challenges, WrongKeys, Keys, Tags, Files, Tracking, Pages, Config from CTFd.models import db, Teams, Solves, Challenges, WrongKeys, Keys, Tags, Files, Tracking, Pages, Config
from itsdangerous import TimedSerializer, BadTimeSignature from itsdangerous import TimedSerializer, BadTimeSignature
@ -45,17 +45,12 @@ def init_admin(app):
@admins_only @admins_only
def admin_config(): def admin_config():
if request.method == "POST": if request.method == "POST":
start = request.form['start'] try:
end = request.form['end'] start = int(request.form['start'])
end = int(request.form['end'])
if not start: except (ValueError, TypeError):
start = None start = None
else:
start = int(start)
if not end:
end = None end = None
else:
end = int(end)
print repr(start), repr(end) print repr(start), repr(end)
@ -243,7 +238,7 @@ def init_admin(app):
@admins_only @admins_only
def ban(teamid): def ban(teamid):
user = Teams.query.filter_by(id=teamid).first() user = Teams.query.filter_by(id=teamid).first()
user.banned = 1; user.banned = 1
db.session.commit() db.session.commit()
return redirect('/scoreboard') return redirect('/scoreboard')
@ -251,7 +246,7 @@ def init_admin(app):
@admins_only @admins_only
def unban(teamid): def unban(teamid):
user = Teams.query.filter_by(id=teamid).first() user = Teams.query.filter_by(id=teamid).first()
user.banned = None; user.banned = None
db.session.commit() db.session.commit()
return redirect('/scoreboard') return redirect('/scoreboard')

View File

@ -1,5 +1,5 @@
from CTFd import render_template, request, redirect, abort, jsonify, url_for, session from flask import render_template, request, redirect, abort, jsonify, url_for, session
from CTFd.utils import sha512, is_safe_url, authed, mailserver from CTFd.utils import sha512, is_safe_url, authed, mailserver, sendmail
from CTFd.models import db, Teams from CTFd.models import db, Teams
from itsdangerous import TimedSerializer, BadTimeSignature from itsdangerous import TimedSerializer, BadTimeSignature

View File

@ -1,10 +1,11 @@
from flask import current_app as app, render_template, request, redirect, abort, jsonify, json as json_mod, url_for from flask import current_app as app, render_template, request, redirect, abort, jsonify, json as json_mod, url_for, session
from CTFd import session, logging
from CTFd.utils import ctftime, authed, unix_time, get_kpm from CTFd.utils import ctftime, authed, unix_time, get_kpm
from CTFd.models import db, Challenges, Files, Solves, WrongKeys, Keys from CTFd.models import db, Challenges, Files, Solves, WrongKeys, Keys
import time import time
import re
import logging
def init_challenges(app): def init_challenges(app):
@app.route('/challenges', methods=['GET']) @app.route('/challenges', methods=['GET'])

View File

@ -1,5 +1,4 @@
from flask import current_app as app from flask import current_app as app, session, render_template, jsonify
from CTFd import session, render_template, jsonify
from CTFd.utils import unix_time from CTFd.utils import unix_time
from CTFd.models import db, Teams, Solves, Challenges from CTFd.models import db, Teams, Solves, Challenges

View File

@ -1,9 +1,10 @@
from CTFd import session
from CTFd.models import db, WrongKeys, Pages, Config from CTFd.models import db, WrongKeys, Pages, Config
from CTFd import mail
from urlparse import urlparse, urljoin from urlparse import urlparse, urljoin
from functools import wraps from functools import wraps
from flask import current_app as app, g, request, redirect, url_for from flask import current_app as app, g, request, redirect, url_for, session
from flask.ext.mail import Message
from socket import inet_aton, inet_ntoa from socket import inet_aton, inet_ntoa
from struct import unpack, pack from struct import unpack, pack

View File

@ -1,5 +1,4 @@
from flask import current_app as app, render_template, render_template_string, request, redirect, abort, jsonify, json as json_mod, url_for from flask import current_app as app, render_template, render_template_string, request, redirect, abort, jsonify, json as json_mod, url_for, session
from CTFd import session
from CTFd.utils import authed, ip2long, long2ip, is_setup from CTFd.utils import authed, ip2long, long2ip, is_setup
from CTFd.models import db, Teams, Solves, Challenges, WrongKeys, Keys, Tags, Files, Tracking, Pages, Config from CTFd.models import db, Teams, Solves, Challenges, WrongKeys, Keys, Tags, Files, Tracking, Pages, Config

View File

@ -7,3 +7,4 @@ SQLAlchemy==0.9.8
passlib==1.6.2 passlib==1.6.2
py-bcrypt==0.4 py-bcrypt==0.4
six==1.8.0 six==1.8.0
itsdangerous