mirror of https://github.com/JohnHammond/CTFd.git
Fixing some mistakes
parent
d2778c30ad
commit
03d8dda878
|
@ -553,20 +553,19 @@ def admin_graph(graph_type):
|
||||||
@admins_only
|
@admins_only
|
||||||
def admin_scoreboard():
|
def admin_scoreboard():
|
||||||
score = db.func.sum(Challenges.value).label('score')
|
score = db.func.sum(Challenges.value).label('score')
|
||||||
scores = db.session.query(Solves.teamid.label('teamid'), Teams.name.label('name'), score, Solves.date.label('date')) \
|
scores = db.session.query(Solves.teamid.label('teamid'), Teams.name.label('name'), Teams.banned.label('banned'), score, Solves.date.label('date')) \
|
||||||
.join(Teams) \
|
.join(Teams) \
|
||||||
.join(Challenges) \
|
.join(Challenges) \
|
||||||
.filter(Teams.banned == None) \
|
|
||||||
.group_by(Solves.teamid)
|
.group_by(Solves.teamid)
|
||||||
|
|
||||||
awards = db.session.query(Teams.id.label('teamid'), Teams.name.label('name'),
|
awards = db.session.query(Teams.id.label('teamid'), Teams.name.label('name'), Teams.banned.label('banned'),
|
||||||
db.func.sum(Awards.value).label('score'), Awards.date.label('date')) \
|
db.func.sum(Awards.value).label('score'), Awards.date.label('date')) \
|
||||||
.filter(Teams.id == Awards.teamid) \
|
.filter(Teams.id == Awards.teamid) \
|
||||||
.group_by(Teams.id)
|
.group_by(Teams.id)
|
||||||
|
|
||||||
results = union_all(scores, awards)
|
results = union_all(scores, awards)
|
||||||
|
|
||||||
standings = db.session.query(results.columns.teamid, results.columns.name,
|
standings = db.session.query(results.columns.teamid, results.columns.name, results.columns.banned,
|
||||||
db.func.sum(results.columns.score).label('score')) \
|
db.func.sum(results.columns.score).label('score')) \
|
||||||
.group_by(results.columns.teamid) \
|
.group_by(results.columns.teamid) \
|
||||||
.order_by(db.func.sum(results.columns.score).desc(), db.func.max(results.columns.date)) \
|
.order_by(db.func.sum(results.columns.score).desc(), db.func.max(results.columns.date)) \
|
||||||
|
|
|
@ -231,7 +231,7 @@ $('#send-user-email').click(function(e){
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#delete-container').click(function(e){
|
$('#delete-user').click(function(e){
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
var id = $('#confirm input[name="id"]').val()
|
var id = $('#confirm input[name="id"]').val()
|
||||||
var user_data = $('#confirm form').serializeArray()
|
var user_data = $('#confirm form').serializeArray()
|
||||||
|
|
Loading…
Reference in New Issue