mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-17 22:14:25 +01:00
Fixing team deletion
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from flask import current_app as app, render_template, request, redirect, jsonify, url_for, Blueprint
|
||||
from CTFd.utils import admins_only, is_admin, cache
|
||||
from CTFd.models import db, Teams, Solves, Awards, Containers, Challenges, WrongKeys, Keys, Tags, Files, Tracking, Pages, Config, DatabaseError
|
||||
from CTFd.models import db, Teams, Solves, Awards, Unlocks, Containers, Challenges, WrongKeys, Keys, Tags, Files, Tracking, Pages, Config, DatabaseError
|
||||
from passlib.hash import bcrypt_sha256
|
||||
from sqlalchemy.sql import not_
|
||||
|
||||
@@ -131,6 +131,8 @@ def unban(teamid):
|
||||
@admins_only
|
||||
def delete_team(teamid):
|
||||
try:
|
||||
Unlocks.query.filter_by(teamid=teamid).delete()
|
||||
Awards.query.filter_by(teamid=teamid).delete()
|
||||
WrongKeys.query.filter_by(teamid=teamid).delete()
|
||||
Solves.query.filter_by(teamid=teamid).delete()
|
||||
Tracking.query.filter_by(team=teamid).delete()
|
||||
|
||||
Reference in New Issue
Block a user