mirror of https://github.com/JohnHammond/CTFd.git
Merge pull request #6 from takeshixx/upstream-fixes
Missing dependencies added, some weird imports fixedselenium-screenshot-testing
commit
7cf762a6c4
|
@ -28,6 +28,7 @@ def create_app(subdomain, username="", password=""):
|
|||
app.db = db
|
||||
# app.setup = True
|
||||
|
||||
global mail
|
||||
mail = Mail(app)
|
||||
|
||||
Session(app)
|
||||
|
|
|
@ -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.models import db, Teams, Solves, Challenges, WrongKeys, Keys, Tags, Files, Tracking, Pages, Config
|
||||
from itsdangerous import TimedSerializer, BadTimeSignature
|
||||
|
@ -45,17 +45,12 @@ def init_admin(app):
|
|||
@admins_only
|
||||
def admin_config():
|
||||
if request.method == "POST":
|
||||
start = request.form['start']
|
||||
end = request.form['end']
|
||||
|
||||
if not start:
|
||||
try:
|
||||
start = int(request.form['start'])
|
||||
end = int(request.form['end'])
|
||||
except (ValueError, TypeError):
|
||||
start = None
|
||||
else:
|
||||
start = int(start)
|
||||
if not end:
|
||||
end = None
|
||||
else:
|
||||
end = int(end)
|
||||
|
||||
print repr(start), repr(end)
|
||||
|
||||
|
@ -243,7 +238,7 @@ def init_admin(app):
|
|||
@admins_only
|
||||
def ban(teamid):
|
||||
user = Teams.query.filter_by(id=teamid).first()
|
||||
user.banned = 1;
|
||||
user.banned = 1
|
||||
db.session.commit()
|
||||
return redirect('/scoreboard')
|
||||
|
||||
|
@ -251,7 +246,7 @@ def init_admin(app):
|
|||
@admins_only
|
||||
def unban(teamid):
|
||||
user = Teams.query.filter_by(id=teamid).first()
|
||||
user.banned = None;
|
||||
user.banned = None
|
||||
db.session.commit()
|
||||
return redirect('/scoreboard')
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
from CTFd import render_template, request, redirect, abort, jsonify, url_for, session
|
||||
from CTFd.utils import sha512, is_safe_url, authed, mailserver
|
||||
from flask import render_template, request, redirect, abort, jsonify, url_for, session
|
||||
from CTFd.utils import sha512, is_safe_url, authed, mailserver, sendmail
|
||||
from CTFd.models import db, Teams
|
||||
|
||||
from itsdangerous import TimedSerializer, BadTimeSignature
|
||||
|
|
|
@ -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.models import db, Challenges, Files, Solves, WrongKeys, Keys
|
||||
|
||||
import time
|
||||
import re
|
||||
import logging
|
||||
|
||||
def init_challenges(app):
|
||||
@app.route('/challenges', methods=['GET'])
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
from flask import current_app as app
|
||||
from CTFd import session, render_template, jsonify
|
||||
from flask import current_app as app, session, render_template, jsonify
|
||||
from CTFd.utils import unix_time
|
||||
from CTFd.models import db, Teams, Solves, Challenges
|
||||
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
from CTFd import session
|
||||
from CTFd.models import db, WrongKeys, Pages, Config
|
||||
from CTFd import mail
|
||||
|
||||
from urlparse import urlparse, urljoin
|
||||
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 struct import unpack, pack
|
||||
|
||||
|
|
|
@ -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 CTFd import session
|
||||
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.utils import authed, ip2long, long2ip, is_setup
|
||||
from CTFd.models import db, Teams, Solves, Challenges, WrongKeys, Keys, Tags, Files, Tracking, Pages, Config
|
||||
|
||||
|
|
|
@ -7,3 +7,4 @@ SQLAlchemy==0.9.8
|
|||
passlib==1.6.2
|
||||
py-bcrypt==0.4
|
||||
six==1.8.0
|
||||
itsdangerous
|
Loading…
Reference in New Issue