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

@ -18,21 +18,21 @@ web_ns = Namespace("web", description="Web application API operations", path="/"
from . import (
app,
audio,
challenges,
completion,
conversation,
feature,
files,
forgot_password,
login,
register,
message,
passport,
red_blue_challenges,
register,
remote_files,
saved_message,
site,
workflow,
challenges,
red_blue_challenges,
)
api.add_namespace(web_ns)
@ -42,20 +42,20 @@ __all__ = [
"app",
"audio",
"bp",
"challenges",
"completion",
"conversation",
"feature",
"files",
"forgot_password",
"login",
"register",
"message",
"passport",
"red_blue_challenges",
"register",
"remote_files",
"saved_message",
"site",
"web_ns",
"workflow",
"challenges",
"red_blue_challenges",
]

View file

@ -1,11 +1,10 @@
from __future__ import annotations
from flask_restx import Resource
from sqlalchemy import select
from controllers.web import web_ns
from extensions.ext_database import db
from sqlalchemy import select
from models.challenge import Challenge, ChallengeAttempt
from models.model import App, Site

View file

@ -16,7 +16,7 @@ class WebRegisterApi(Resource):
name = payload.get('name') or 'Player'
password = payload.get('password')
if not email or not password:
return { 'result': 'bad_request' }, 400
return {'result': 'bad_request'}, 400
account = RegisterService.register(
email=email,
name=name,
@ -25,6 +25,6 @@ class WebRegisterApi(Resource):
create_workspace_required=False,
)
db.session.commit()
return { 'result': 'success', 'data': { 'account_id': account.id } }, 201
return {'result': 'success', 'data': {'account_id': account.id}}, 201