feat: stream challenge submissions and tidy challenge imports
This commit is contained in:
parent
8fd3c4bb64
commit
cb4cde0ed2
13 changed files with 309 additions and 93 deletions
|
|
@ -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",
|
||||
]
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue