feat: stream challenge submissions and tidy challenge imports

This commit is contained in:
Joey Yakimowich-Payne 2025-10-01 14:33:44 -06:00
commit cb4cde0ed2
No known key found for this signature in database
GPG key ID: 6BFE655FA5ABD1E1
13 changed files with 309 additions and 93 deletions

View file

@ -44,6 +44,10 @@ from . import (
version,
)
# Import custom challenge controllers
from . import challenges as challenges
from . import red_blue_challenges as red_blue_challenges
# Import app controllers
from .app import (
advanced_prompt_template,
@ -129,10 +133,6 @@ from .workspace import (
workspace,
)
# Import custom challenge controllers
from . import challenges as challenges
from . import red_blue_challenges as red_blue_challenges
api.add_namespace(console_ns)
__all__ = [
@ -149,6 +149,7 @@ __all__ = [
"audio",
"billing",
"bp",
"challenges",
"completion",
"compliance",
"console_ns",
@ -193,6 +194,7 @@ __all__ = [
"rag_pipeline_import",
"rag_pipeline_workflow",
"recommended_app",
"red_blue_challenges",
"saved_message",
"setup",
"site",
@ -208,6 +210,4 @@ __all__ = [
"workflow_run",
"workflow_statistic",
"workspace",
"challenges",
"red_blue_challenges",
]

View file

@ -7,9 +7,8 @@ from controllers.console.wraps import (
account_initialization_required,
setup_required,
)
from libs.login import login_required
from extensions.ext_database import db
from libs.login import current_user
from libs.login import current_user, login_required
from models.challenge import Challenge
@ -72,7 +71,7 @@ class ChallengeListCreateApi(Resource):
c.app_id = args["app_id"]
# Convert empty string to None for UUID field
workflow_id = args.get("workflow_id")
c.workflow_id = workflow_id if workflow_id else None
c.workflow_id = workflow_id or None
c.name = args["name"]
c.description = args.get("description")
c.goal = args.get("goal")