mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-17 14:04:20 +01:00
Fix challenge filter in /api/v1/statistics/challenges/solves (#1529)
* Fix showing hidden challenge solve count in admin statistics page
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
from flask_restx import Resource
|
from flask_restx import Resource
|
||||||
from sqlalchemy import func
|
from sqlalchemy import func
|
||||||
from sqlalchemy.sql import or_
|
from sqlalchemy.sql import and_
|
||||||
|
|
||||||
from CTFd.api.v1.statistics import statistics_namespace
|
from CTFd.api.v1.statistics import statistics_namespace
|
||||||
from CTFd.models import Challenges, Solves, db
|
from CTFd.models import Challenges, Solves, db
|
||||||
@@ -31,7 +31,7 @@ class ChallengeSolveStatistics(Resource):
|
|||||||
def get(self):
|
def get(self):
|
||||||
chals = (
|
chals = (
|
||||||
Challenges.query.filter(
|
Challenges.query.filter(
|
||||||
or_(Challenges.state != "hidden", Challenges.state != "locked")
|
and_(Challenges.state != "hidden", Challenges.state != "locked")
|
||||||
)
|
)
|
||||||
.order_by(Challenges.value)
|
.order_by(Challenges.value)
|
||||||
.all()
|
.all()
|
||||||
|
|||||||
Reference in New Issue
Block a user